Portail captif
[ongolaboy.git] / projets_django / bacgl_django / messagerie / migrations / 0007_recuperationAlias.py
1 # -*- coding: utf-8 -*-
2 import datetime
3 from south.db import db
4 from south.v2 import DataMigration
5 from django.db import models
6
7 class Migration(DataMigration):
8
9 def forwards(self, orm):
10 "Write your forwards methods here."
11 # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
12 for curseur in orm['ancien_messagerie.Virtual'].objects.all():
13 orm['messagerie.Alias']().objects.get_or_create(
14 nom=curseur.user +'@'+ curseur.domain,
15 # date_creation = datetime.datetime.now(),
16 )
17
18 def backwards(self, orm):
19 "Write your backwards methods here."
20
21 models = {
22 'ancien_messagerie.auth': {
23 'Meta': {'object_name': 'Auth', 'db_table': "u'auth'"},
24 'actif': ('django.db.models.fields.IntegerField', [], {}),
25 'expire': ('django.db.models.fields.IntegerField', [], {}),
26 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
27 'password': ('django.db.models.fields.CharField', [], {'max_length': '384'}),
28 'source': ('django.db.models.fields.CharField', [], {'max_length': '192'}),
29 'user': ('django.db.models.fields.CharField', [], {'max_length': '384'})
30 },
31 'ancien_messagerie.mailbox': {
32 'Meta': {'object_name': 'Mailbox', 'db_table': "u'mailbox'"},
33 'actif': ('django.db.models.fields.IntegerField', [], {}),
34 'domain': ('django.db.models.fields.CharField', [], {'max_length': '384'}),
35 'expire': ('django.db.models.fields.IntegerField', [], {}),
36 'homedir': ('django.db.models.fields.CharField', [], {'max_length': '768'}),
37 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
38 'source': ('django.db.models.fields.CharField', [], {'max_length': '192'}),
39 'user': ('django.db.models.fields.CharField', [], {'max_length': '384'})
40 },
41 'ancien_messagerie.virtual': {
42 'Meta': {'object_name': 'Virtual', 'db_table': "u'virtual'"},
43 'actif': ('django.db.models.fields.IntegerField', [], {}),
44 'destination': ('django.db.models.fields.CharField', [], {'max_length': '768'}),
45 'domain': ('django.db.models.fields.CharField', [], {'max_length': '384'}),
46 'expire': ('django.db.models.fields.IntegerField', [], {}),
47 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
48 'source': ('django.db.models.fields.CharField', [], {'max_length': '192'}),
49 'user': ('django.db.models.fields.CharField', [], {'max_length': '384'})
50 },
51 'messagerie.alias': {
52 'Meta': {'object_name': 'Alias'},
53 'date_creation': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
54 'nom': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'primary_key': 'True'}),
55 'observations': ('django.db.models.fields.TextField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}),
56 'responsable': ('django.db.models.fields.CharField', [], {'default': "'Support technique'", 'max_length': '256'})
57 },
58 'messagerie.auth': {
59 'Meta': {'ordering': "['user']", 'object_name': 'Auth'},
60 'actif': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
61 'expire': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
62 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
63 'password': ('django.db.models.fields.CharField', [], {'max_length': '384'}),
64 'source': ('django.db.models.fields.CharField', [], {'default': "'LOCAL'", 'max_length': '192'}),
65 'user': ('django.db.models.fields.CharField', [], {'max_length': '384'})
66 },
67 'messagerie.mailbox': {
68 'Meta': {'ordering': "['proprietaire']", 'object_name': 'Mailbox'},
69 'domain': ('django.db.models.fields.CharField', [], {'default': "'cm.auf.org'", 'max_length': '384'}),
70 'homedir': ('django.db.models.fields.CharField', [], {'default': "'/var/mail/vhosts/,'", 'max_length': '768'}),
71 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
72 'proprietaire': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['messagerie.Auth']"})
73 }
74 }
75
76 complete_apps = ['ancien_messagerie', 'messagerie']
77 symmetrical = True