##// END OF EJS Templates
Show thread, post and tag names in admin with python3
neko259 -
r875:dc78f601 default
parent child Browse files
Show More
@@ -230,9 +230,8 b' class Post(models.Model, Viewable):'
230 db_index=True)
230 db_index=True)
231 refmap = models.TextField(null=True, blank=True)
231 refmap = models.TextField(null=True, blank=True)
232
232
233 def __unicode__(self):
233 def __str__(self):
234 return '#' + str(self.id) + ' ' + self.title + ' (' + \
234 return '#{} {} ({})'.format(self.id, self.title, self.text.raw[:50])
235 self.text.raw[:50] + ')'
236
235
237 def get_title(self):
236 def get_title(self):
238 """
237 """
@@ -39,7 +39,7 b' class Tag(models.Model, Viewable):'
39 threads = models.ManyToManyField(Thread, null=True,
39 threads = models.ManyToManyField(Thread, null=True,
40 blank=True, related_name='tag+')
40 blank=True, related_name='tag+')
41
41
42 def __unicode__(self):
42 def __str__(self):
43 return self.name
43 return self.name
44
44
45 def is_empty(self):
45 def is_empty(self):
@@ -183,3 +183,6 b' class Thread(models.Model):'
183 self.replies.all().delete()
183 self.replies.all().delete()
184
184
185 super(Thread, self).delete(using)
185 super(Thread, self).delete(using)
186
187 def __str__(self):
188 return '{}/#{}'.format(self.id, self.get_opening_post_id())
General Comments 0
You need to be logged in to leave comments. Login now