Recopie de la table mailbox
[ongolaboy.git] / projets_django / bacgl_django / messagerie / models.py
1 # -*- coding: utf-8 -*-
2
3 from django.db import models
4
5 CHOIX_BINAIRE = (
6 (1, "Oui"),
7 (0, "Non"),
8 )
9
10 class Auth(models.Model):
11 """
12 Informations sur l'authentification des utilisateurs
13 """
14
15 user = models.CharField(max_length=384)
16 password = models.CharField(max_length=384)
17 actif = models.IntegerField(choices=CHOIX_BINAIRE,default=1)
18 expire = models.IntegerField(choices=CHOIX_BINAIRE,default=0)
19 source = models.CharField(max_length=192,default='LOCAL')
20
21 class Meta:
22 ordering = ['user']
23 verbose_name = 'compte'
24
25 def __unicode__(self):
26 return self.user
27
28 class Mailbox(models.Model):
29 """
30 Informations sur l'emplacement des boîtes aux lettres
31 """
32
33 proprietaire = models.ForeignKey(Auth)
34 domain = models.CharField(max_length=384, default="cm.auf.org")
35 homedir = models.CharField(max_length=768,
36 default="/var/mail/vhost/cm.auf.org")
37
38 def __unicode__(self):
39 return self.homedir