[#2664] Permettre des valeurs NULL sur les éléments 2 et 3
authorEric Mc Sween <eric.mcsween@auf.org>
Tue, 28 Feb 2012 16:51:55 +0000 (11:51 -0500)
committerEric Mc Sween <eric.mcsween@auf.org>
Tue, 28 Feb 2012 16:51:55 +0000 (11:51 -0500)
auf/django/coda/managedcoda/migrations/0001_initial.py [new file with mode: 0644]
auf/django/coda/managedcoda/migrations/0002_auto__chg_field_ligne_projet_poste.py [new file with mode: 0644]
auf/django/coda/managedcoda/migrations/0003_auto__chg_field_ligne_tiers_operation.py [new file with mode: 0644]
auf/django/coda/managedcoda/migrations/__init__.py [new file with mode: 0644]
auf/django/coda/managedcoda/models.py

diff --git a/auf/django/coda/managedcoda/migrations/0001_initial.py b/auf/django/coda/managedcoda/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..c3614dc
--- /dev/null
@@ -0,0 +1,137 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+    
+    def forwards(self, orm):
+        
+        # Adding model 'PCG'
+        db.create_table('coda_pcg', (
+            ('timestamp', self.gf('django.db.models.fields.BigIntegerField')()),
+            ('code', self.gf('django.db.models.fields.CharField')(max_length=72, primary_key=True)),
+            ('nom', self.gf('django.db.models.fields.CharField')(max_length=36)),
+        ))
+        db.send_create_signal('managedcoda', ['PCG'])
+
+        # Adding model 'TiersOperation'
+        db.create_table('coda_tiersoperation', (
+            ('timestamp', self.gf('django.db.models.fields.BigIntegerField')()),
+            ('code', self.gf('django.db.models.fields.CharField')(max_length=72, primary_key=True)),
+            ('nom', self.gf('django.db.models.fields.CharField')(max_length=36)),
+        ))
+        db.send_create_signal('managedcoda', ['TiersOperation'])
+
+        # Adding model 'ProjetPoste'
+        db.create_table('coda_projetposte', (
+            ('timestamp', self.gf('django.db.models.fields.BigIntegerField')()),
+            ('code', self.gf('django.db.models.fields.CharField')(max_length=72, primary_key=True)),
+            ('nom', self.gf('django.db.models.fields.CharField')(max_length=36)),
+        ))
+        db.send_create_signal('managedcoda', ['ProjetPoste'])
+
+        # Adding model 'Ecriture'
+        db.create_table('coda_ecriture', (
+            ('code', self.gf('django.db.models.fields.CharField')(max_length=12)),
+            ('timestamp', self.gf('django.db.models.fields.BigIntegerField')()),
+            ('numero', self.gf('django.db.models.fields.CharField')(max_length=12)),
+            ('periode', self.gf('django.db.models.fields.IntegerField')()),
+            ('date', self.gf('django.db.models.fields.DateField')()),
+            ('annee', self.gf('django.db.models.fields.IntegerField')()),
+            ('id', self.gf('django.db.models.fields.CharField')(max_length=25, primary_key=True)),
+        ))
+        db.send_create_signal('managedcoda', ['Ecriture'])
+
+        # Adding model 'Ligne'
+        db.create_table('coda_ligne', (
+            ('projet_poste', self.gf('django.db.models.fields.related.ForeignKey')(related_name='lignes', to=orm['managedcoda.ProjetPoste'])),
+            ('salarie', self.gf('django.db.models.fields.CharField')(max_length=32)),
+            ('description', self.gf('django.db.models.fields.CharField')(max_length=36)),
+            ('implantation', self.gf('django.db.models.fields.CharField')(max_length=32)),
+            ('ecriture', self.gf('django.db.models.fields.related.ForeignKey')(related_name='lignes', to=orm['managedcoda.Ecriture'])),
+            ('debit_credit', self.gf('django.db.models.fields.CharField')(max_length=1)),
+            ('montant_eur', self.gf('django.db.models.fields.DecimalField')(max_digits=17, decimal_places=2)),
+            ('numero', self.gf('django.db.models.fields.IntegerField')()),
+            ('id', self.gf('django.db.models.fields.CharField')(max_length=36, primary_key=True)),
+            ('numero_avoir', self.gf('django.db.models.fields.CharField')(max_length=32)),
+            ('etat_paiement', self.gf('django.db.models.fields.CharField')(max_length=1)),
+            ('timestamp', self.gf('django.db.models.fields.BigIntegerField')()),
+            ('numero_cheque', self.gf('django.db.models.fields.CharField')(max_length=32)),
+            ('numero_facture', self.gf('django.db.models.fields.CharField')(max_length=32)),
+            ('pcg', self.gf('django.db.models.fields.related.ForeignKey')(related_name='lignes', to=orm['managedcoda.PCG'])),
+            ('tiers_operation', self.gf('django.db.models.fields.related.ForeignKey')(related_name='lignes', to=orm['managedcoda.TiersOperation'])),
+        ))
+        db.send_create_signal('managedcoda', ['Ligne'])
+    
+    
+    def backwards(self, orm):
+        
+        # Deleting model 'PCG'
+        db.delete_table('coda_pcg')
+
+        # Deleting model 'TiersOperation'
+        db.delete_table('coda_tiersoperation')
+
+        # Deleting model 'ProjetPoste'
+        db.delete_table('coda_projetposte')
+
+        # Deleting model 'Ecriture'
+        db.delete_table('coda_ecriture')
+
+        # Deleting model 'Ligne'
+        db.delete_table('coda_ligne')
+    
+    
+    models = {
+        'managedcoda.ecriture': {
+            'Meta': {'object_name': 'Ecriture', 'db_table': "'coda_ecriture'"},
+            'annee': ('django.db.models.fields.IntegerField', [], {}),
+            'code': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
+            'date': ('django.db.models.fields.DateField', [], {}),
+            'id': ('django.db.models.fields.CharField', [], {'max_length': '25', 'primary_key': 'True'}),
+            'numero': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
+            'periode': ('django.db.models.fields.IntegerField', [], {}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        },
+        'managedcoda.ligne': {
+            'Meta': {'object_name': 'Ligne', 'db_table': "'coda_ligne'"},
+            'debit_credit': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
+            'description': ('django.db.models.fields.CharField', [], {'max_length': '36'}),
+            'ecriture': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lignes'", 'to': "orm['managedcoda.Ecriture']"}),
+            'etat_paiement': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
+            'id': ('django.db.models.fields.CharField', [], {'max_length': '36', 'primary_key': 'True'}),
+            'implantation': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'montant_eur': ('django.db.models.fields.DecimalField', [], {'max_digits': '17', 'decimal_places': '2'}),
+            'numero': ('django.db.models.fields.IntegerField', [], {}),
+            'numero_avoir': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'numero_cheque': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'numero_facture': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'pcg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lignes'", 'to': "orm['managedcoda.PCG']"}),
+            'projet_poste': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lignes'", 'to': "orm['managedcoda.ProjetPoste']"}),
+            'salarie': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'tiers_operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lignes'", 'to': "orm['managedcoda.TiersOperation']"}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        },
+        'managedcoda.pcg': {
+            'Meta': {'object_name': 'PCG', 'db_table': "'coda_pcg'"},
+            'code': ('django.db.models.fields.CharField', [], {'max_length': '72', 'primary_key': 'True'}),
+            'nom': ('django.db.models.fields.CharField', [], {'max_length': '36'}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        },
+        'managedcoda.projetposte': {
+            'Meta': {'object_name': 'ProjetPoste', 'db_table': "'coda_projetposte'"},
+            'code': ('django.db.models.fields.CharField', [], {'max_length': '72', 'primary_key': 'True'}),
+            'nom': ('django.db.models.fields.CharField', [], {'max_length': '36'}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        },
+        'managedcoda.tiersoperation': {
+            'Meta': {'object_name': 'TiersOperation', 'db_table': "'coda_tiersoperation'"},
+            'code': ('django.db.models.fields.CharField', [], {'max_length': '72', 'primary_key': 'True'}),
+            'nom': ('django.db.models.fields.CharField', [], {'max_length': '36'}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        }
+    }
+    
+    complete_apps = ['managedcoda']
diff --git a/auf/django/coda/managedcoda/migrations/0002_auto__chg_field_ligne_projet_poste.py b/auf/django/coda/managedcoda/migrations/0002_auto__chg_field_ligne_projet_poste.py
new file mode 100644 (file)
index 0000000..8ed074e
--- /dev/null
@@ -0,0 +1,71 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+    
+    def forwards(self, orm):
+        
+        # Changing field 'Ligne.projet_poste'
+        db.alter_column('coda_ligne', 'projet_poste_id', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, null=True, to=orm['managedcoda.ProjetPoste']))
+    
+    
+    def backwards(self, orm):
+        
+        # Changing field 'Ligne.projet_poste'
+        db.alter_column('coda_ligne', 'projet_poste_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['managedcoda.ProjetPoste']))
+    
+    
+    models = {
+        'managedcoda.ecriture': {
+            'Meta': {'object_name': 'Ecriture', 'db_table': "'coda_ecriture'"},
+            'annee': ('django.db.models.fields.IntegerField', [], {}),
+            'code': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
+            'date': ('django.db.models.fields.DateField', [], {}),
+            'id': ('django.db.models.fields.CharField', [], {'max_length': '25', 'primary_key': 'True'}),
+            'numero': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
+            'periode': ('django.db.models.fields.IntegerField', [], {}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        },
+        'managedcoda.ligne': {
+            'Meta': {'object_name': 'Ligne', 'db_table': "'coda_ligne'"},
+            'debit_credit': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
+            'description': ('django.db.models.fields.CharField', [], {'max_length': '36'}),
+            'ecriture': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lignes'", 'to': "orm['managedcoda.Ecriture']"}),
+            'etat_paiement': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
+            'id': ('django.db.models.fields.CharField', [], {'max_length': '36', 'primary_key': 'True'}),
+            'implantation': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'montant_eur': ('django.db.models.fields.DecimalField', [], {'max_digits': '17', 'decimal_places': '2'}),
+            'numero': ('django.db.models.fields.IntegerField', [], {}),
+            'numero_avoir': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'numero_cheque': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'numero_facture': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'pcg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lignes'", 'to': "orm['managedcoda.PCG']"}),
+            'projet_poste': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'lignes'", 'null': 'True', 'to': "orm['managedcoda.ProjetPoste']"}),
+            'salarie': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'tiers_operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lignes'", 'to': "orm['managedcoda.TiersOperation']"}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        },
+        'managedcoda.pcg': {
+            'Meta': {'object_name': 'PCG', 'db_table': "'coda_pcg'"},
+            'code': ('django.db.models.fields.CharField', [], {'max_length': '72', 'primary_key': 'True'}),
+            'nom': ('django.db.models.fields.CharField', [], {'max_length': '36'}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        },
+        'managedcoda.projetposte': {
+            'Meta': {'object_name': 'ProjetPoste', 'db_table': "'coda_projetposte'"},
+            'code': ('django.db.models.fields.CharField', [], {'max_length': '72', 'primary_key': 'True'}),
+            'nom': ('django.db.models.fields.CharField', [], {'max_length': '36'}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        },
+        'managedcoda.tiersoperation': {
+            'Meta': {'object_name': 'TiersOperation', 'db_table': "'coda_tiersoperation'"},
+            'code': ('django.db.models.fields.CharField', [], {'max_length': '72', 'primary_key': 'True'}),
+            'nom': ('django.db.models.fields.CharField', [], {'max_length': '36'}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        }
+    }
+    
+    complete_apps = ['managedcoda']
diff --git a/auf/django/coda/managedcoda/migrations/0003_auto__chg_field_ligne_tiers_operation.py b/auf/django/coda/managedcoda/migrations/0003_auto__chg_field_ligne_tiers_operation.py
new file mode 100644 (file)
index 0000000..e60b884
--- /dev/null
@@ -0,0 +1,71 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+    
+    def forwards(self, orm):
+        
+        # Changing field 'Ligne.tiers_operation'
+        db.alter_column('coda_ligne', 'tiers_operation_id', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, null=True, to=orm['managedcoda.TiersOperation']))
+    
+    
+    def backwards(self, orm):
+        
+        # Changing field 'Ligne.tiers_operation'
+        db.alter_column('coda_ligne', 'tiers_operation_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['managedcoda.TiersOperation']))
+    
+    
+    models = {
+        'managedcoda.ecriture': {
+            'Meta': {'object_name': 'Ecriture', 'db_table': "'coda_ecriture'"},
+            'annee': ('django.db.models.fields.IntegerField', [], {}),
+            'code': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
+            'date': ('django.db.models.fields.DateField', [], {}),
+            'id': ('django.db.models.fields.CharField', [], {'max_length': '25', 'primary_key': 'True'}),
+            'numero': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
+            'periode': ('django.db.models.fields.IntegerField', [], {}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        },
+        'managedcoda.ligne': {
+            'Meta': {'object_name': 'Ligne', 'db_table': "'coda_ligne'"},
+            'debit_credit': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
+            'description': ('django.db.models.fields.CharField', [], {'max_length': '36'}),
+            'ecriture': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lignes'", 'to': "orm['managedcoda.Ecriture']"}),
+            'etat_paiement': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
+            'id': ('django.db.models.fields.CharField', [], {'max_length': '36', 'primary_key': 'True'}),
+            'implantation': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'montant_eur': ('django.db.models.fields.DecimalField', [], {'max_digits': '17', 'decimal_places': '2'}),
+            'numero': ('django.db.models.fields.IntegerField', [], {}),
+            'numero_avoir': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'numero_cheque': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'numero_facture': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'pcg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lignes'", 'to': "orm['managedcoda.PCG']"}),
+            'projet_poste': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'lignes'", 'null': 'True', 'to': "orm['managedcoda.ProjetPoste']"}),
+            'salarie': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+            'tiers_operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'lignes'", 'null': 'True', 'to': "orm['managedcoda.TiersOperation']"}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        },
+        'managedcoda.pcg': {
+            'Meta': {'object_name': 'PCG', 'db_table': "'coda_pcg'"},
+            'code': ('django.db.models.fields.CharField', [], {'max_length': '72', 'primary_key': 'True'}),
+            'nom': ('django.db.models.fields.CharField', [], {'max_length': '36'}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        },
+        'managedcoda.projetposte': {
+            'Meta': {'object_name': 'ProjetPoste', 'db_table': "'coda_projetposte'"},
+            'code': ('django.db.models.fields.CharField', [], {'max_length': '72', 'primary_key': 'True'}),
+            'nom': ('django.db.models.fields.CharField', [], {'max_length': '36'}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        },
+        'managedcoda.tiersoperation': {
+            'Meta': {'object_name': 'TiersOperation', 'db_table': "'coda_tiersoperation'"},
+            'code': ('django.db.models.fields.CharField', [], {'max_length': '72', 'primary_key': 'True'}),
+            'nom': ('django.db.models.fields.CharField', [], {'max_length': '36'}),
+            'timestamp': ('django.db.models.fields.BigIntegerField', [], {})
+        }
+    }
+    
+    complete_apps = ['managedcoda']
diff --git a/auf/django/coda/managedcoda/migrations/__init__.py b/auf/django/coda/managedcoda/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index 463ce45..9e9dadc 100644 (file)
@@ -69,8 +69,8 @@ class Ligne(models.Model):
     numero = models.IntegerField()
     timestamp = models.BigIntegerField()
     pcg = models.ForeignKey(PCG, related_name='lignes')
-    tiers_operation = models.ForeignKey(TiersOperation, related_name='lignes')
-    projet_poste = models.ForeignKey(ProjetPoste, related_name='lignes')
+    tiers_operation = models.ForeignKey(TiersOperation, related_name='lignes', blank=True, null=True)
+    projet_poste = models.ForeignKey(ProjetPoste, related_name='lignes', blank=True, null=True)
     description = models.CharField(max_length=36)
     montant_eur = models.DecimalField(max_digits=17, decimal_places=2)
     debit_credit = models.CharField(max_length=1, choices=DEBIT_CREDIT_CHOICES)