From ed4eca37fc7680a7f88d213af68b740f046aad17 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 18 Feb 2011 16:25:53 -0600 Subject: Add unicode methods for packages models Signed-off-by: Dan McGee --- packages/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'packages') 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') -- cgit v1.2.3-24-g4f1b