summaryrefslogtreecommitdiff
path: root/main/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-02-15 19:31:56 -0600
committerDan McGee <dan@archlinux.org>2011-02-16 17:43:50 -0600
commit7f1c7b08227e49172734f09552ceae8bc1f685ad (patch)
tree79104fdca2aa1035a8ee8f42079314b50b27823a /main/models.py
parent4444f25d5cd9a9e1cb310a2d9c0b6b1ec1f55789 (diff)
Read in optional deps and show in web interface
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main/models.py')
-rw-r--r--main/models.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/models.py b/main/models.py
index b1813c3c..dafbb1eb 100644
--- a/main/models.py
+++ b/main/models.py
@@ -209,7 +209,7 @@ class Package(models.Model):
"""
deps = []
# TODO: we can use list comprehension and an 'in' query to make this more effective
- for dep in self.packagedepend_set.order_by('depname'):
+ for dep in self.packagedepend_set.order_by('optional', 'depname'):
pkgs = Package.objects.select_related('arch', 'repo').filter(
pkgname=dep.depname)
if not self.arch.agnostic:
@@ -320,12 +320,12 @@ class PackageFile(models.Model):
class PackageDepend(models.Model):
pkg = models.ForeignKey(Package)
depname = models.CharField(max_length=255, db_index=True)
- depvcmp = models.CharField(max_length=255)
+ depvcmp = models.CharField(max_length=255, default='')
optional = models.BooleanField(default=False)
description = models.TextField(null=True, blank=True)
def __unicode__(self):
- return "%s%s" % (depname, depvcmp)
+ return "%s%s" % (self.depname, self.depvcmp)
class Meta:
db_table = 'package_depends'