summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-08-04 15:07:03 -0500
committerDan McGee <dan@archlinux.org>2012-08-04 15:11:27 -0500
commitf61e61c8a6fc0753359963a836bf65a3a8b1981e (patch)
tree8cb2740a691cdfcb574e9f71165bd5d22773c641 /packages
parentc130414a478080519219872ebd842d139d1f139e (diff)
Include description in Depend unicode() output
This overrides the base class __unicode__ method. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r--packages/models.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/models.py b/packages/models.py
index 65aa8f4a..1959183f 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')