small update in models : idUser and idArtcle are not required anymore to allow anyone to connect and add a new empty book
--- a/server/ammico/models.py Fri Apr 03 15:02:19 2015 +0200
+++ b/server/ammico/models.py Fri Apr 03 15:03:04 2015 +0200
@@ -8,7 +8,7 @@
class Book(models.Model):
user = models.ForeignKey(AmmicoUser, related_name = "books")
- idArticle = models.CharField(max_length=512, unique=True)
+ idArticle = models.CharField(max_length=512, unique=True, null=True)
title = models.CharField(max_length=512, blank=True)
description = models.CharField(max_length=512, blank=True, null=True)
image = models.URLField(max_length=2048, blank=True)
--- a/server/ammico/serializers.py Fri Apr 03 15:02:19 2015 +0200
+++ b/server/ammico/serializers.py Fri Apr 03 15:03:04 2015 +0200
@@ -13,7 +13,7 @@
class Meta:
model = Book
- fields = ('id', 'idArticle', 'title', 'description', 'image', 'date')
+ fields = ('id', 'user', 'idArticle', 'title', 'description', 'image', 'date')
class SlideSerializer(serializers.ModelSerializer):
details = serializers.SerializerMethodField('getStopInfo')
--- a/server/authentication/models.py Fri Apr 03 15:02:19 2015 +0200
+++ b/server/authentication/models.py Fri Apr 03 15:03:04 2015 +0200
@@ -1,14 +1,10 @@
-import json
-from django.contrib.auth.models import AbstractUser, BaseUserManager
+from django.contrib.auth.models import AbstractUser
from django.db import models
-from django.utils import timezone
-import requests
-from config import URL_JAMESPOT
class AmmicoUser(AbstractUser):
- idUser = models.CharField(max_length=50, unique=True, blank=True)
+ idUser = models.CharField(max_length=50, blank=True)
class Profile(models.Model):
user = models.OneToOneField(AmmicoUser)