Gave comments.FreeComment a get_absolute_url() method

git-svn-id: http://code.djangoproject.com/svn/django/trunk@354 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-07-30 18:56:36 +00:00
parent 716d00a314
commit 8b36eb11d3
1 changed files with 3 additions and 0 deletions

View File

@ -186,6 +186,9 @@ class FreeComment(meta.Model):
def __repr__(self):
return "%s: %s..." % (self.person_name, self.comment[:100])
def get_absolute_url(self):
return self.get_content_object().get_absolute_url() + "#c" + str(self.id)
def get_content_object(self):
"""
Returns the object that this comment is a comment on. Returns None if