comparison news/models.py @ 1206:02181fa5ac9d modernize tip

Update to Django 1.9.
author Brian Neal <bgneal@gmail.com>
date Wed, 22 Jan 2025 17:58:16 -0600
parents 9fc12bbc8c81
children
comparison
equal deleted inserted replaced
1205:510ef3cbf3e6 1206:02181fa5ac9d
40 40
41 41
42 class StoryBase(models.Model): 42 class StoryBase(models.Model):
43 """Abstract model to collect common fields.""" 43 """Abstract model to collect common fields."""
44 title = models.CharField(max_length=255) 44 title = models.CharField(max_length=255)
45 submitter = models.ForeignKey(User) 45 submitter = models.ForeignKey(User, on_delete=models.CASCADE)
46 category = models.ForeignKey(Category) 46 category = models.ForeignKey(Category, on_delete=models.CASCADE)
47 short_text = models.TextField(default='', blank=True) 47 short_text = models.TextField(default='', blank=True)
48 long_text = models.TextField(default='', blank=True) 48 long_text = models.TextField(default='', blank=True)
49 date_submitted = models.DateTimeField(db_index=True) 49 date_submitted = models.DateTimeField(db_index=True)
50 allow_comments = models.BooleanField(default=True) 50 allow_comments = models.BooleanField(default=True)
51 tags = TagField() 51 tags = TagField()