diff options
author | Dan McGee <dan@archlinux.org> | 2012-08-04 22:07:03 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-08-04 22:11:27 +0200 |
commit | f61e61c8a6fc0753359963a836bf65a3a8b1981e (patch) | |
tree | 8cb2740a691cdfcb574e9f71165bd5d22773c641 /packages | |
parent | c130414a478080519219872ebd842d139d1f139e (diff) | |
download | archweb-f61e61c8a6fc0753359963a836bf65a3a8b1981e.tar.gz archweb-f61e61c8a6fc0753359963a836bf65a3a8b1981e.tar.xz |
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.py | 7 |
1 files changed, 7 insertions, 0 deletions
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') |