summaryrefslogtreecommitdiff
path: root/pgweb/profserv
diff options
context:
space:
mode:
Diffstat (limited to 'pgweb/profserv')
-rw-r--r--pgweb/profserv/admin.py4
-rw-r--r--pgweb/profserv/models.py11
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',)