mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-06 09:57:57 +00:00
Get rid of PgModel, replacing it with simple signals
We were already using signals for everything except delete, and even in our old version of django the delete signal exists (it didn't exist when this code was first written). Django doesn't really like models to be OOP like this, so keeping PgModel would cause issues with upcoming changes in django 1.8. Using simple functions is easier, and the actual functionality is replicated straight off.
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
from django.db import models
|
||||
|
||||
from pgweb.util.bases import PgModel
|
||||
|
||||
class MailingListGroup(PgModel, models.Model):
|
||||
class MailingListGroup(models.Model):
|
||||
groupname = models.CharField(max_length=64, null=False, blank=False)
|
||||
sortkey = models.IntegerField(null=False, default=10)
|
||||
|
||||
@ -18,7 +16,7 @@ class MailingListGroup(PgModel, models.Model):
|
||||
class Meta:
|
||||
ordering = ('sortkey', )
|
||||
|
||||
class MailingList(PgModel, models.Model):
|
||||
class MailingList(models.Model):
|
||||
group = models.ForeignKey(MailingListGroup, null=False)
|
||||
listname = models.CharField(max_length=64, null=False, blank=False)
|
||||
active = models.BooleanField(null=False, default=False)
|
||||
|
Reference in New Issue
Block a user