carto_1_1 : ForeignKey et saisie de données
[davin.git] / ateliers / django / carto_1_1 / annuaire / migrations / 0003_fk_universite.py
1 # -*- encoding: utf-8 -*-
2
3 from south.db import db
4 from django.db import models
5 from annuaire.models import *
6
7 class Migration:
8
9 def forwards(self, orm):
10
11 # Adding field 'Personne.universite'
12 db.add_column('annuaire_personne', 'universite', orm['annuaire.personne:universite'])
13
14
15
16 def backwards(self, orm):
17
18 # Deleting field 'Personne.universite'
19 db.delete_column('annuaire_personne', 'universite_id')
20
21
22
23 models = {
24 'annuaire.etablissement': {
25 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
26 'nom': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
27 'sigle': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'})
28 },
29 'annuaire.personne': {
30 'date_naissance': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
31 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
32 'nom': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
33 'prenom': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
34 'universite': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['annuaire.Etablissement']", 'null': 'True', 'blank': 'True'})
35 }
36 }
37
38 complete_apps = ['annuaire']