summaryrefslogtreecommitdiff
path: root/packages/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-02-07 13:45:05 -0600
committerDan McGee <dan@archlinux.org>2011-02-15 13:51:11 -0600
commit4444f25d5cd9a9e1cb310a2d9c0b6b1ec1f55789 (patch)
tree8d1cff4d938f317cb1d09a872ce6fba91b7a3124 /packages/models.py
parent30756f13efccef1e3b2cdbf9ac9855abc77b065c (diff)
Move license to a related model
This allows us to store multiple licenses per package in a more elegant fashion, and will later allow us to search and filter on this information. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/models.py')
-rw-r--r--packages/models.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/models.py b/packages/models.py
index c217a692..5aa213d1 100644
--- a/packages/models.py
+++ b/packages/models.py
@@ -31,4 +31,14 @@ class PackageGroup(models.Model):
def __unicode__(self):
return self.name
+class License(models.Model):
+ pkg = models.ForeignKey('main.Package', related_name='licenses')
+ name = models.CharField(max_length=255)
+
+ def __unicode__(self):
+ return self.name
+
+ class Meta:
+ ordering = ['name']
+
# vim: set ts=4 sw=4 et: