diff options
-rw-r--r-- | mediagoblin/db/mixin.py | 9 | ||||
-rw-r--r-- | mediagoblin/db/models.py | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/mediagoblin/db/mixin.py b/mediagoblin/db/mixin.py index 3e9ed3a0..1f2e7ec3 100644 --- a/mediagoblin/db/mixin.py +++ b/mediagoblin/db/mixin.py @@ -305,13 +305,20 @@ class MediaCommentMixin(object): """ return cleaned_markdown_conversion(self.content) - def __repr__(self): + def __unicode__(self): return u'<{klass} #{id} {author} "{comment}">'.format( klass=self.__class__.__name__, id=self.id, author=self.get_author, comment=self.content) + def __repr__(self): + return '<{klass} #{id} {author} "{comment}">'.format( + klass=self.__class__.__name__, + id=self.id, + author=self.get_author, + comment=self.content) + class CollectionMixin(GenerateSlugMixin): def check_slug_used(self, slug): diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index aaceb599..c2d101ac 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -820,6 +820,14 @@ class Notification(Base): } def __repr__(self): + return '<{klass} #{id}: {user}: {subject} ({seen})>'.format( + id=self.id, + klass=self.__class__.__name__, + user=self.user, + subject=getattr(self, 'subject', None), + seen='unseen' if not self.seen else 'seen') + + def __unicode__(self): return u'<{klass} #{id}: {user}: {subject} ({seen})>'.format( id=self.id, klass=self.__class__.__name__, |