Commit initial, version 0.2
authorEric Mc Sween <eric.mcsween@auf.org>
Wed, 5 Oct 2011 16:38:42 +0000 (12:38 -0400)
committerEric Mc Sween <eric.mcsween@auf.org>
Wed, 5 Oct 2011 16:38:42 +0000 (12:38 -0400)
.gitignore [new file with mode: 0644]
auf/__init__.py [new file with mode: 0644]
auf/django/__init__.py [new file with mode: 0644]
auf/django/coda/__init__.py [new file with mode: 0644]
auf/django/coda/models.py [new file with mode: 0755]
setup.py [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..1fd8d72
--- /dev/null
@@ -0,0 +1,3 @@
+*.pyc
+dist/
+*.egg-info
diff --git a/auf/__init__.py b/auf/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/auf/django/__init__.py b/auf/django/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/auf/django/coda/__init__.py b/auf/django/coda/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/auf/django/coda/models.py b/auf/django/coda/models.py
new file mode 100755 (executable)
index 0000000..fc539ba
--- /dev/null
@@ -0,0 +1,65 @@
+# encoding: utf-8
+
+from django.conf import settings
+from django.db import models
+
+
+class Element(models.Model):
+    id = models.CharField(max_length=74, primary_key=True)
+    niveau = models.IntegerField()
+    code = models.CharField(max_length=72)
+    date_modification = models.DateField()
+    nom = models.CharField(max_length=36)
+
+    class Meta:
+        managed = False
+        db_table = 'coda_element'
+
+
+class Ecriture(models.Model):
+    id = models.CharField(max_length=25, primary_key=True)
+    code = models.CharField(max_length=12)
+    numero = models.CharField(max_length=12)
+    date_modification = models.DateField()
+    periode = models.IntegerField()
+    annee = models.IntegerField()
+    date = models.DateField()
+
+    class Meta:
+        managed = False
+        db_table = 'coda_ecriture'
+
+
+class LigneEcriture(models.Model):
+    DEBIT_CREDIT_CHOICES = (
+        ('D', 'Débit'),
+        ('C', 'Crédit'),
+    )
+    ETAT_PAIEMENT_CHOICES = (
+        ('D', 'D-Disponible'),
+        ('A', 'A-Attente'),
+        ('X', 'X-Fermé (non-lettrable)'),
+        ('P', 'P-Payé'),
+        ('O', 'O-Proposé'),
+    )
+
+    id = models.CharField(max_length=36, primary_key=True)
+    ecriture = models.ForeignKey(Ecriture, related_name='doclines')
+    numero = models.IntegerField()
+    date_modification = models.DateField()
+    compte_comptable = models.ForeignKey(Element, related_name='+', db_index=True)
+    tiers_operation = models.ForeignKey(Element, related_name='+', db_index=True)
+    projet_poste = models.ForeignKey(Element, related_name='+', db_index=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)
+    numero_facture = models.CharField(max_length=32)
+    numero_avoir = models.CharField(max_length=32)
+    implantation = models.CharField(max_length=32)
+    salarie = models.CharField(max_length=32)
+    numero_cheque = models.CharField(max_length=32)
+    etat_paiement = models.CharField(max_length=1, choices=ETAT_PAIEMENT_CHOICES)
+
+    class Meta:
+        managed = False
+        db_table = 'coda_ligne_ecriture'
diff --git a/setup.py b/setup.py
new file mode 100644 (file)
index 0000000..637cc30
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,24 @@
+# encoding: utf-8
+
+import os
+import sys
+from setuptools import setup, find_packages
+
+name = 'auf.django.coda'
+version = '0.2'
+
+setup(name=name,
+      version=version,
+      description="Modèles Django pour les données CODA",
+      long_description="",
+      classifiers=[],
+      keywords='',
+      author='Éric Mc Sween',
+      author_email='eric.mcsween@auf.org',
+      url='http://pypi.auf.org/%s' % name,
+      license='GPL',
+      packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
+      include_package_data=True,
+      zip_safe=False,
+      install_requires=[],
+      entry_points="")