summaryrefslogtreecommitdiff
path: root/packages/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-02-07 12:48:12 -0600
committerDan McGee <dan@archlinux.org>2011-02-15 13:51:11 -0600
commit376ce4a69e016d13eff28589a5caa627bf7c451b (patch)
tree347ffffa3db13e4d8a4f3c49379e6e3c28139de1 /packages/models.py
parent8c5358e88898c4eb620a132133c57a26f191dee1 (diff)
Clean up Package related objects code
Main change is just to move groups from the default packagegroup_set location to a related_name of groups. Also refer to the Package class directly rather than by text string if we have it available. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/models.py')
-rw-r--r--packages/models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/models.py b/packages/models.py
index 70ac4fe5..c217a692 100644
--- a/packages/models.py
+++ b/packages/models.py
@@ -25,7 +25,10 @@ class PackageGroup(models.Model):
Represents a group a package is in. There is no actual group entity,
only names that link to given packages.
'''
- pkg = models.ForeignKey('main.Package')
+ pkg = models.ForeignKey('main.Package', related_name='groups')
name = models.CharField(max_length=255)
+ def __unicode__(self):
+ return self.name
+
# vim: set ts=4 sw=4 et: