summaryrefslogtreecommitdiff
path: root/pgmailmgr/mailmgr/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'pgmailmgr/mailmgr/models.py')
-rw-r--r--pgmailmgr/mailmgr/models.py98
1 files changed, 49 insertions, 49 deletions
diff --git a/pgmailmgr/mailmgr/models.py b/pgmailmgr/mailmgr/models.py
index 3f2cb07..86100b4 100644
--- a/pgmailmgr/mailmgr/models.py
+++ b/pgmailmgr/mailmgr/models.py
@@ -3,73 +3,73 @@ from django.contrib.auth.models import User
from django.db.models import signals
class LocalDomain(models.Model):
- local_domain_id = models.AutoField(null=False, primary_key=True)
- domain_name = models.CharField(max_length=100, null=False, blank=False)
- path = models.CharField(max_length=512, null=False, blank=False)
- unix_user = models.IntegerField(null=False, blank=False, default=0)
- unix_group = models.IntegerField(null=False, blank=False, default=0)
+ local_domain_id = models.AutoField(null=False, primary_key=True)
+ domain_name = models.CharField(max_length=100, null=False, blank=False)
+ path = models.CharField(max_length=512, null=False, blank=False)
+ unix_user = models.IntegerField(null=False, blank=False, default=0)
+ unix_group = models.IntegerField(null=False, blank=False, default=0)
- def __unicode__(self):
- return self.domain_name
+ def __unicode__(self):
+ return self.domain_name
- trigger_update = True
- class Meta:
- ordering=('domain_name',)
- db_table='mail"."local_domains'
- managed=False
+ trigger_update = True
+ class Meta:
+ ordering=('domain_name',)
+ db_table='mail"."local_domains'
+ managed=False
class Forwarder(models.Model):
- forwarder_id = models.AutoField(null=False, primary_key=True)
- local_part = models.CharField(max_length=100, null=False, blank=False)
- local_domain = models.ForeignKey(LocalDomain, null=False, blank=False, db_column='local_domain_id')
- remote_name = models.CharField(max_length=200, null=False, blank=False)
+ forwarder_id = models.AutoField(null=False, primary_key=True)
+ local_part = models.CharField(max_length=100, null=False, blank=False)
+ local_domain = models.ForeignKey(LocalDomain, null=False, blank=False, db_column='local_domain_id')
+ remote_name = models.CharField(max_length=200, null=False, blank=False)
- def __unicode__(self):
- return "%s@%s -> %s" % (self.local_part, self.local_domain.domain_name, self.remote_name)
+ def __unicode__(self):
+ return "%s@%s -> %s" % (self.local_part, self.local_domain.domain_name, self.remote_name)
- trigger_update = True
- class Meta:
- ordering=('local_part',)
- db_table='mail"."forwarder'
- managed=False
+ trigger_update = True
+ class Meta:
+ ordering=('local_part',)
+ db_table='mail"."forwarder'
+ managed=False
class VirtualUser(models.Model):
- virtual_user_id = models.AutoField(null=False, primary_key=True)
- local_domain = models.ForeignKey(LocalDomain, null=False, blank=False, db_column='local_domain_id')
- local_part = models.CharField(max_length=100, null=False, blank=False)
- mail_quota = models.IntegerField(null=False)
- passwd = models.CharField(max_length=100, null=False, blank=False, verbose_name="Password")
- full_name = models.CharField(max_length=200, null=False, blank=True)
+ virtual_user_id = models.AutoField(null=False, primary_key=True)
+ local_domain = models.ForeignKey(LocalDomain, null=False, blank=False, db_column='local_domain_id')
+ local_part = models.CharField(max_length=100, null=False, blank=False)
+ mail_quota = models.IntegerField(null=False)
+ passwd = models.CharField(max_length=100, null=False, blank=False, verbose_name="Password")
+ full_name = models.CharField(max_length=200, null=False, blank=True)
- def __unicode__(self):
- return "%s@%s (%s)" % (self.local_part, self.local_domain.domain_name, self.full_name or '')
+ def __unicode__(self):
+ return "%s@%s (%s)" % (self.local_part, self.local_domain.domain_name, self.full_name or '')
- trigger_update = True
- class Meta:
- ordering=('local_part',)
- db_table='mail"."virtual_user'
- managed=False
- unique_together=('local_domain', 'local_part', )
+ trigger_update = True
+ class Meta:
+ ordering=('local_part',)
+ db_table='mail"."virtual_user'
+ managed=False
+ unique_together=('local_domain', 'local_part', )
class UserPermissions(models.Model):
- user = models.ForeignKey(User, null=False)
- domain = models.ForeignKey(LocalDomain, null=False)
- pattern = models.CharField(max_length=100, null=False, blank=False)
+ user = models.ForeignKey(User, null=False)
+ domain = models.ForeignKey(LocalDomain, null=False)
+ pattern = models.CharField(max_length=100, null=False, blank=False)
- def __unicode__(self):
- return "%s -> %s pattern '%s'" % (self.user, self.domain, self.pattern)
+ def __unicode__(self):
+ return "%s -> %s pattern '%s'" % (self.user, self.domain, self.pattern)
class Log(models.Model):
- user = models.ForeignKey(User, null=False)
- when = models.DateTimeField(null=False, auto_now=True)
- what = models.CharField(max_length=2048, null=False, blank=False)
+ user = models.ForeignKey(User, null=False)
+ when = models.DateTimeField(null=False, auto_now=True)
+ what = models.CharField(max_length=2048, null=False, blank=False)
- def __unicode__(self):
- return "%s (%s): %s" % (self.when, self.user, self.what)
+ def __unicode__(self):
+ return "%s (%s): %s" % (self.when, self.user, self.what)
- class Meta:
- ordering=('-when',)
+ class Meta:
+ ordering=('-when',)
def pgmail_save_handler(sender, **kwargs):
if hasattr(sender, 'trigger_update') and sender.trigger_update: