summaryrefslogtreecommitdiff
path: root/main/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 /main/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 'main/models.py')
-rw-r--r--main/models.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/main/models.py b/main/models.py
index ff2ecf02..dc73c986 100644
--- a/main/models.py
+++ b/main/models.py
@@ -309,14 +309,18 @@ class Signoff(models.Model):
packager = models.ForeignKey(User)
class PackageFile(models.Model):
- pkg = models.ForeignKey('Package')
+ pkg = models.ForeignKey(Package)
path = models.CharField(max_length=255)
+
+ def __unicode__(self):
+ return self.path
+
class Meta:
db_table = 'package_files'
class PackageDepend(models.Model):
- pkg = models.ForeignKey('Package')
- depname = models.CharField(db_index=True, max_length=255)
+ pkg = models.ForeignKey(Package)
+ depname = models.CharField(max_length=255, db_index=True)
depvcmp = models.CharField(max_length=255)
class Meta:
db_table = 'package_depends'
@@ -349,8 +353,8 @@ class Todolist(models.Model):
return '/todo/%i/' % self.id
class TodolistPkg(models.Model):
- list = models.ForeignKey('Todolist')
- pkg = models.ForeignKey('Package')
+ list = models.ForeignKey(Todolist)
+ pkg = models.ForeignKey(Package)
complete = models.BooleanField(default=False)
class Meta:
db_table = 'todolist_pkgs'