From abddf4149e40a6915ff6a24fcc08e3321f22424f Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 26 Jun 2012 14:32:13 +0200 Subject: [PATCH] Rename publisher->org in Product model This is requied to support notifications, and good for consistency in general. --- pgweb/downloads/admin.py | 2 +- pgweb/downloads/models.py | 4 ++-- templates/downloads/productlist.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pgweb/downloads/admin.py b/pgweb/downloads/admin.py index b4674c37..d08e3757 100644 --- a/pgweb/downloads/admin.py +++ b/pgweb/downloads/admin.py @@ -9,7 +9,7 @@ class MirrorAdmin(admin.ModelAdmin): ordering = ('country_code', ) class ProductAdmin(PgwebAdmin): - list_display = ('name', 'publisher', 'approved', 'lastconfirmed',) + list_display = ('name', 'org', 'approved', 'lastconfirmed',) list_filter = ('approved',) search_fields = ('name', 'description', ) ordering = ('name', ) diff --git a/pgweb/downloads/models.py b/pgweb/downloads/models.py index b8957ef3..4ace231a 100644 --- a/pgweb/downloads/models.py +++ b/pgweb/downloads/models.py @@ -78,7 +78,7 @@ class LicenceType(models.Model): class Product(PgModel, models.Model): name = models.CharField(max_length=100, null=False, blank=False, unique=True) approved = models.BooleanField(null=False, default=False) - publisher = models.ForeignKey(Organisation, null=False) + org = models.ForeignKey(Organisation, db_column="publisher_id", null=False) url = models.URLField(null=False, blank=False) category = models.ForeignKey(Category, null=False) licencetype = models.ForeignKey(LicenceType, null=False, verbose_name="Licence type") @@ -93,7 +93,7 @@ class Product(PgModel, models.Model): return self.name def verify_submitter(self, user): - return (len(self.publisher.managers.filter(pk=user.pk)) == 1) + return (len(self.org.managers.filter(pk=user.pk)) == 1) class Meta: ordering = ('name',) diff --git a/templates/downloads/productlist.html b/templates/downloads/productlist.html index ae03f5cf..8cf95d56 100644 --- a/templates/downloads/productlist.html +++ b/templates/downloads/productlist.html @@ -31,7 +31,7 @@ {%endif%} Publisher - {{product.publisher.name}} + {{product.org.name}} -- 2.39.5