diff options
author | Dan McGee <dan@archlinux.org> | 2011-02-18 16:25:53 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-02-18 23:55:11 -0600 |
commit | ed4eca37fc7680a7f88d213af68b740f046aad17 (patch) | |
tree | 6da1b5d64767782e852cf76f74d2cfb39b44fc5e /packages | |
parent | 8d3d05c7cb81611537aa34fa68e98e5e22b74847 (diff) |
Add unicode methods for packages models
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r-- | packages/models.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/models.py b/packages/models.py index 5aa213d1..bc36f787 100644 --- a/packages/models.py +++ b/packages/models.py @@ -17,6 +17,11 @@ class PackageRelation(models.Model): pkgbase = models.CharField(max_length=255) user = models.ForeignKey(User, related_name="package_relations") type = models.PositiveIntegerField(choices=TYPE_CHOICES, default=MAINTAINER) + + def __unicode__(self): + return "%s: %s (%s)" % ( + self.pkgbase, self.user, self.get_type_display()) + class Meta: unique_together = (('pkgbase', 'user', 'type'),) @@ -29,7 +34,7 @@ class PackageGroup(models.Model): name = models.CharField(max_length=255) def __unicode__(self): - return self.name + return "%s: %s" % (name, pkg) class License(models.Model): pkg = models.ForeignKey('main.Package', related_name='licenses') |