Portail captif
[ongolaboy.git] / projets_django / bacgl_django / messagerie / migrations / 0005_recopieMailbox.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 cle in orm['messagerie.Auth'].objects.all():
13 for boite in orm['ancien_messagerie.Mailbox'].objects.all():
14 if boite.user == cle.user:
15 orm['messagerie.Mailbox']().objects.get_or_create(proprietaire_id=cle.id,
16 domain=boite.domain,
17 homedir=boite.homedir)
18
19 def backwards(self, orm):
20 "Write your backwards methods here."
21
22 models = {
23 'ancien_messagerie.auth': {
24 'Meta': {'object_name': 'Auth', 'db_table': "u'auth'"},
25 'actif': ('django.db.models.fields.IntegerField', [], {}),
26 'expire': ('django.db.models.fields.IntegerField', [], {}),
27 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
28 'password': ('django.db.models.fields.CharField', [], {'max_length': '384'}),
29 'source': ('django.db.models.fields.CharField', [], {'max_length': '192'}),
30 'user': ('django.db.models.fields.CharField', [], {'max_length': '384'})
31 },
32 'ancien_messagerie.mailbox': {
33 'Meta': {'object_name': 'Mailbox', 'db_table': "u'mailbox'"},
34 'actif': ('django.db.models.fields.IntegerField', [], {}),
35 'domain': ('django.db.models.fields.CharField', [], {'max_length': '384'}),
36 'expire': ('django.db.models.fields.IntegerField', [], {}),
37 'homedir': ('django.db.models.fields.CharField', [], {'max_length': '768'}),
38 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
39 'source': ('django.db.models.fields.CharField', [], {'max_length': '192'}),
40 'user': ('django.db.models.fields.CharField', [], {'max_length': '384'})
41 },
42 'ancien_messagerie.virtual': {
43 'Meta': {'object_name': 'Virtual', 'db_table': "u'virtual'"},
44 'actif': ('django.db.models.fields.IntegerField', [], {}),
45 'destination': ('django.db.models.fields.CharField', [], {'max_length': '768'}),
46 'domain': ('django.db.models.fields.CharField', [], {'max_length': '384'}),
47 'expire': ('django.db.models.fields.IntegerField', [], {}),
48 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
49 'source': ('django.db.models.fields.CharField', [], {'max_length': '192'}),
50 'user': ('django.db.models.fields.CharField', [], {'max_length': '384'})
51 },
52 'messagerie.auth': {
53 'Meta': {'ordering': "['user']", 'object_name': 'Auth'},
54 'actif': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
55 'expire': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
56 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
57 'password': ('django.db.models.fields.CharField', [], {'max_length': '384'}),
58 'source': ('django.db.models.fields.CharField', [], {'default': "'LOCAL'", 'max_length': '192'}),
59 'user': ('django.db.models.fields.CharField', [], {'max_length': '384'})
60 },
61 'messagerie.mailbox': {
62 'Meta': {'object_name': 'Mailbox'},
63 'domain': ('django.db.models.fields.CharField', [], {'default': "'cm.auf.org'", 'max_length': '384'}),
64 'homedir': ('django.db.models.fields.CharField', [], {'default': "'/var/mail/vhost/cm.auf.org'", 'max_length': '768'}),
65 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
66 'proprietaire': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['messagerie.Auth']"})
67 }
68 }
69
70 complete_apps = ['ancien_messagerie', 'messagerie']
71 symmetrical = True