Mercurial > public > sg101
comparison ygroup/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 | eeaf387803c6 |
children |
comparison
equal
deleted
inserted
replaced
1205:510ef3cbf3e6 | 1206:02181fa5ac9d |
---|---|
24 def get_absolute_url(self): | 24 def get_absolute_url(self): |
25 return reverse('ygroup-thread_view', args=[self.pk]) | 25 return reverse('ygroup-thread_view', args=[self.pk]) |
26 | 26 |
27 | 27 |
28 class Post(models.Model): | 28 class Post(models.Model): |
29 thread = models.ForeignKey(Thread, null=True, blank=True, | 29 thread = models.ForeignKey( |
30 Thread, null=True, blank=True, | |
30 on_delete=models.SET_NULL, related_name='posts') | 31 on_delete=models.SET_NULL, related_name='posts') |
31 title = models.CharField(max_length=255) | 32 title = models.CharField(max_length=255) |
32 creation_date = models.DateTimeField() | 33 creation_date = models.DateTimeField() |
33 poster = models.CharField(max_length=128) | 34 poster = models.CharField(max_length=128) |
34 msg = models.TextField() | 35 msg = models.TextField() |