Add message.topic_name() helper function.

This little helper will facilitate adding a new Topic
table in the future.
This commit is contained in:
Steve Howell
2016-07-14 08:48:11 -07:00
committed by Tim Abbott
parent a5b9e3b893
commit 9d7716f368
6 changed files with 15 additions and 8 deletions

View File

@@ -780,6 +780,13 @@ class Message(ModelReprMixin, models.Model):
has_image = models.BooleanField(default=False, db_index=True) # type: bool
has_link = models.BooleanField(default=False, db_index=True) # type: bool
def topic_name(self):
# type: () -> text_type
"""
Please start using this helper to facilitate an
eventual switch over to a separate topic table.
"""
return self.subject
def __unicode__(self):
# type: () -> text_type