summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-02-18 23:25:53 +0100
committerDan McGee <dan@archlinux.org>2011-02-19 06:55:11 +0100
commited4eca37fc7680a7f88d213af68b740f046aad17 (patch)
tree6da1b5d64767782e852cf76f74d2cfb39b44fc5e /packages
parent8d3d05c7cb81611537aa34fa68e98e5e22b74847 (diff)
downloadarchweb-ed4eca37fc7680a7f88d213af68b740f046aad17.tar.gz
archweb-ed4eca37fc7680a7f88d213af68b740f046aad17.tar.xz
Add unicode methods for packages models
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r--packages/models.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/models.py b/packages/models.py
index 5aa213d..bc36f78 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')