geschichten/stories/writingtogether/models.py

15 lines
446 B
Python
Raw Normal View History

2021-03-30 21:25:52 +02:00
from django.contrib.auth import get_user_model
from django.db import models
from django.db.models import CASCADE
User = get_user_model()
class Story(models.Model):
name = models.CharField(max_length=256, null=True, blank=True)
created = models.DateTimeField()
class StoryPart(models.Model):
user = models.ForeignKey(User, on_delete=CASCADE)
text = models.TextField()
part_of = models.ForeignKey('Story', on_delete=CASCADE)