add first migration and updates requirements
authorrougeronj
Thu, 04 Jun 2015 20:08:01 +0200
changeset 112 53dc561c38d1
parent 111 6b397990e314
child 113 b8400d8efac8
add first migration and updates requirements
server/ammico/migrations/0001_initial.py
server/authentication/migrations/0001_initial.py
server/authentication/views.py
server/requirements.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/server/ammico/migrations/0001_initial.py	Thu Jun 04 20:08:01 2015 +0200
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+from django.conf import settings
+import taggit.managers
+import datetime
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+        ('taggit', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Book',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
+                ('idArticle', models.CharField(max_length=512, null=True, blank=True)),
+                ('title', models.CharField(max_length=512, blank=True)),
+                ('description', models.CharField(max_length=512, null=True, blank=True)),
+                ('image', models.URLField(max_length=2048, blank=True)),
+                ('date', models.DateTimeField(default=datetime.datetime.now)),
+                ('public', models.BooleanField(default=False, db_index=True)),
+                ('parent_visit', models.ForeignKey(null=True, related_name='books_copy', to='ammico.Book', blank=True)),
+                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='books')),
+            ],
+            options={
+            },
+            bases=(models.Model,),
+        ),
+        migrations.CreateModel(
+            name='Slide',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
+                ('idStop', models.CharField(max_length=512, blank=True)),
+                ('idInventory', models.CharField(max_length=512, blank=True)),
+                ('title', models.CharField(max_length=512, blank=True)),
+                ('description', models.CharField(max_length=1024, blank=True)),
+                ('image', models.URLField(max_length=2048, blank=True)),
+                ('date', models.DateTimeField(default=datetime.datetime.now)),
+                ('favorite', models.BooleanField(default=False, db_index=True)),
+                ('book', models.ForeignKey(to='ammico.Book', related_name='slides')),
+                ('tags', taggit.managers.TaggableManager(through='taggit.TaggedItem', help_text='A comma-separated list of tags.', to='taggit.Tag', verbose_name='Tags', blank=True)),
+            ],
+            options={
+            },
+            bases=(models.Model,),
+        ),
+        migrations.AlterOrderWithRespectTo(
+            name='slide',
+            order_with_respect_to='book',
+        ),
+    ]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/server/authentication/migrations/0001_initial.py	Thu Jun 04 20:08:01 2015 +0200
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+from django.conf import settings
+import django.utils.timezone
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='AmmicoUser',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
+                ('password', models.CharField(max_length=128, verbose_name='password')),
+                ('last_login', models.DateTimeField(default=django.utils.timezone.now, verbose_name='last login')),
+                ('email', models.EmailField(max_length=255, unique=True, verbose_name='email address')),
+                ('idUser', models.IntegerField(verbose_name='identifiant utilisateur', null=True, blank=True)),
+                ('is_active', models.BooleanField(default=True)),
+                ('is_admin', models.BooleanField(default=False)),
+            ],
+            options={
+                'abstract': False,
+            },
+            bases=(models.Model,),
+        ),
+        migrations.CreateModel(
+            name='Profile',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
+                ('image', models.URLField(max_length=2048, blank=True)),
+                ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
+            ],
+            options={
+            },
+            bases=(models.Model,),
+        ),
+    ]
--- a/server/authentication/views.py	Thu Jun 04 20:07:25 2015 +0200
+++ b/server/authentication/views.py	Thu Jun 04 20:08:01 2015 +0200
@@ -23,7 +23,6 @@
     permission_classes = (permissions.AllowAny,)
     
     def get(self, request):
-        print ("here ?")
         user = get_user_model().objects.all()
         serializer = UserSerializer(user, many=True)
         return Response(serializer.data)
--- a/server/requirements.txt	Thu Jun 04 20:07:25 2015 +0200
+++ b/server/requirements.txt	Thu Jun 04 20:08:01 2015 +0200
@@ -1,7 +1,8 @@
 Django==1.7.6
 django-cors-headers==1.0.0
-django-taggit==0.12.3
+django-taggit==0.14.0
 djangorestframework==3.1.0
 psycopg2==2.6
+PyJWT==1.3.0
 requests==2.5.3
 xmltodict==0.9.2