From f61e61c8a6fc0753359963a836bf65a3a8b1981e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 4 Aug 2012 15:07:03 -0500 Subject: Include description in Depend unicode() output This overrides the base class __unicode__ method. Signed-off-by: Dan McGee --- packages/models.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'packages') diff --git a/packages/models.py b/packages/models.py index 65aa8f4..1959183 100644 --- a/packages/models.py +++ b/packages/models.py @@ -416,6 +416,13 @@ class Depend(RelatedToBase): deptype = models.CharField(max_length=1, default='D', choices=DEPTYPE_CHOICES) + def __unicode__(self): + '''For depends, we may also have a description and a modifier.''' + to_str = super(Depend, self).__unicode__() + if self.description: + return u'%s: %s' % (to_str, self.description) + return to_str + class Conflict(RelatedToBase): pkg = models.ForeignKey(Package, related_name='conflicts') -- cgit v1.2.3-24-g4f1b