summaryrefslogtreecommitdiff
path: root/main/models.py
diff options
context:
space:
mode:
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'