Mercurial > public > sg101
comparison gpp/forums/models.py @ 97:96eec1ed0fd3
Render the forum page navigation in the view with render_to_string() to avoid doing it twice in the template code. Also undo a mistake in the last commit. Need 2 different orderings for Post objects: by creation date in normal views, and by reverse creation date in the admin.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 13 Sep 2009 19:58:31 +0000 |
parents | 93d9e74a471e |
children | d0d779dd0832 |
comparison
equal
deleted
inserted
replaced
96:93d9e74a471e | 97:96eec1ed0fd3 |
---|---|
117 body = models.TextField() | 117 body = models.TextField() |
118 html = models.TextField() | 118 html = models.TextField() |
119 user_ip = models.IPAddressField(blank=True, default='', null=True) | 119 user_ip = models.IPAddressField(blank=True, default='', null=True) |
120 | 120 |
121 class Meta: | 121 class Meta: |
122 ordering = ('-creation_date', ) | 122 ordering = ('creation_date', ) |
123 | 123 |
124 @models.permalink | 124 @models.permalink |
125 def get_absolute_url(self): | 125 def get_absolute_url(self): |
126 return ('forums-goto_post', [self.pk]) | 126 return ('forums-goto_post', [self.pk]) |
127 | 127 |