comparison gpp/forums/models.py @ 91:62af8cd8f57b

Forums: added support for Post get_absolute_url()
author Brian Neal <bgneal@gmail.com>
date Sun, 13 Sep 2009 04:05:37 +0000
parents 5b4c812b448e
children 93d9e74a471e
comparison
equal deleted inserted replaced
90:317c7bcaecee 91:62af8cd8f57b
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
125 def get_absolute_url(self):
126 return ('forums-goto_post', [self.pk])
127
124 def summary(self): 128 def summary(self):
125 LIMIT = 50 129 LIMIT = 50
126 if len(self.body) < LIMIT: 130 if len(self.body) < LIMIT:
127 return self.body 131 return self.body
128 return self.body[:LIMIT] + '...' 132 return self.body[:LIMIT] + '...'