summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/models.py5
-rw-r--r--packages/views.py3
2 files changed, 5 insertions, 3 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:
diff --git a/packages/views.py b/packages/views.py
index 4f7c3b93..9c34db0c 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -104,8 +104,7 @@ def group_details(request, arch, name):
arch = get_object_or_404(Arch, name=arch)
arches = [ arch ]
arches.extend(Arch.objects.filter(agnostic=True))
- pkgs = Package.objects.filter(packagegroup__name=name,
- arch__in=arches)
+ pkgs = Package.objects.filter(groups__name=name, arch__in=arches)
pkgs = pkgs.order_by('pkgname')
if len(pkgs) == 0:
raise Http404