diff options
author | Magnus Hagander | 2012-06-26 12:25:38 +0000 |
---|---|---|
committer | Magnus Hagander | 2012-06-26 12:34:26 +0000 |
commit | 4cbb54a1d7ba1f96a17c56c1c59dfbce7c36473c (patch) | |
tree | 1f0f8bb95465cffb1a11d3568a78eaccc7dc7265 /pgweb/profserv | |
parent | 1aa15247fd3a31c03f41c8f2aaeaec3ef92f6062 (diff) |
Rename organisation->org in ProfessionalService model
This is requied to support notifications, and good for consistency
in general.
Diffstat (limited to 'pgweb/profserv')
-rw-r--r-- | pgweb/profserv/admin.py | 4 | ||||
-rw-r--r-- | pgweb/profserv/models.py | 11 |
2 files changed, 8 insertions, 7 deletions
diff --git a/pgweb/profserv/admin.py b/pgweb/profserv/admin.py index 204ecc7f..56f4f3a5 100644 --- a/pgweb/profserv/admin.py +++ b/pgweb/profserv/admin.py @@ -1,4 +1,4 @@ -from django.contrib import admin +from util.admin import register_pgwebadmin from models import * -admin.site.register(ProfessionalService) +register_pgwebadmin(ProfessionalService) diff --git a/pgweb/profserv/models.py b/pgweb/profserv/models.py index e8e96a6e..b155320b 100644 --- a/pgweb/profserv/models.py +++ b/pgweb/profserv/models.py @@ -7,8 +7,9 @@ from pgweb.util.bases import PgModel class ProfessionalService(PgModel, models.Model): approved = models.BooleanField(null=False, blank=False, default=False) - organisation = models.ForeignKey(Organisation, null=False, blank=False, unique=True, - help_text="If no organisations are listed, please check the <a href=\"/account/orglist/\">organisation list</a> and contact the organisation manager or webmaster@postgresql.org if none are listed.") + org = models.ForeignKey(Organisation, null=False, blank=False, unique=True, + db_column="organisation_id", + help_text="If no organisations are listed, please check the <a href=\"/account/orglist/\">organisation list</a> and contact the organisation manager or webmaster@postgresql.org if none are listed.") description = models.TextField(null=False,blank=False) employees = models.CharField(max_length=32, null=True, blank=True) locations = models.CharField(max_length=128, null=True, blank=True) @@ -33,11 +34,11 @@ class ProfessionalService(PgModel, models.Model): send_notification = True def verify_submitter(self, user): - return (len(self.organisation.managers.filter(pk=user.pk)) == 1) + return (len(self.org.managers.filter(pk=user.pk)) == 1) def __unicode__(self): - return self.organisation.name + return self.org.name class Meta: - ordering = ('organisation__name',) + ordering = ('org__name',) |