From 9d9e319a3892248af0f37303eaff0d9901d38b25 Mon Sep 17 00:00:00 2001 From: Willy MANGA Date: Thu, 29 May 2014 10:41:14 +0100 Subject: [PATCH] =?utf8?q?Pr=C3=A9paration=20nouvelle=20app=20messagerie?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../bacgl_django/bacgl_django/settings.py | 1 + .../messagerie/migrations/0001_initial.py | 40 ++++++++++++++++++++ projets_django/bacgl_django/messagerie/models.py | 15 +++++++- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 projets_django/bacgl_django/messagerie/migrations/0001_initial.py create mode 100644 projets_django/bacgl_django/messagerie/migrations/__init__.py diff --git a/projets_django/bacgl_django/bacgl_django/settings.py b/projets_django/bacgl_django/bacgl_django/settings.py index 4518a3a..ad26205 100644 --- a/projets_django/bacgl_django/bacgl_django/settings.py +++ b/projets_django/bacgl_django/bacgl_django/settings.py @@ -133,6 +133,7 @@ INSTALLED_APPS = ( 'django.contrib.staticfiles', 'south', 'ancien_messagerie', + 'messagerie', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: diff --git a/projets_django/bacgl_django/messagerie/migrations/0001_initial.py b/projets_django/bacgl_django/messagerie/migrations/0001_initial.py new file mode 100644 index 0000000..2529366 --- /dev/null +++ b/projets_django/bacgl_django/messagerie/migrations/0001_initial.py @@ -0,0 +1,40 @@ +# -*- coding: 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 'Auth' + db.create_table('messagerie_auth', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('user', self.gf('django.db.models.fields.CharField')(max_length=384)), + ('password', self.gf('django.db.models.fields.CharField')(max_length=384)), + ('actif', self.gf('django.db.models.fields.IntegerField')()), + ('expire', self.gf('django.db.models.fields.IntegerField')()), + ('source', self.gf('django.db.models.fields.CharField')(max_length=192)), + )) + db.send_create_signal('messagerie', ['Auth']) + + + def backwards(self, orm): + # Deleting model 'Auth' + db.delete_table('messagerie_auth') + + + models = { + 'messagerie.auth': { + 'Meta': {'object_name': 'Auth'}, + 'actif': ('django.db.models.fields.IntegerField', [], {}), + 'expire': ('django.db.models.fields.IntegerField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '384'}), + 'source': ('django.db.models.fields.CharField', [], {'max_length': '192'}), + 'user': ('django.db.models.fields.CharField', [], {'max_length': '384'}) + } + } + + complete_apps = ['messagerie'] \ No newline at end of file diff --git a/projets_django/bacgl_django/messagerie/migrations/__init__.py b/projets_django/bacgl_django/messagerie/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/projets_django/bacgl_django/messagerie/models.py b/projets_django/bacgl_django/messagerie/models.py index 71a8362..8297a3b 100644 --- a/projets_django/bacgl_django/messagerie/models.py +++ b/projets_django/bacgl_django/messagerie/models.py @@ -1,3 +1,16 @@ from django.db import models -# Create your models here. +CHOIX_BINAIRE = ( + (1, "Actif"), + (0, "Inactif"), + ) + +class Auth(models.Model): + user = models.CharField(max_length=384) + password = models.CharField(max_length=384) + actif = models.IntegerField(choices=CHOIX_BINAIRE) + expire = models.IntegerField(choices=CHOIX_BINAIRE) + source = models.CharField(max_length=192) + + def __unicode__(): + return self.user -- 1.7.10.4