# HG changeset patch # User rougeronj # Date 1428066184 -7200 # Node ID bd7bcfc86232067b9159fbcf516de49989b6c6a6 # Parent a5f9739dcd46fba13cc41323d381cd57bea3dbaa small update in models : idUser and idArtcle are not required anymore to allow anyone to connect and add a new empty book diff -r a5f9739dcd46 -r bd7bcfc86232 server/ammico/models.py --- 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) diff -r a5f9739dcd46 -r bd7bcfc86232 server/ammico/serializers.py --- 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') diff -r a5f9739dcd46 -r bd7bcfc86232 server/authentication/models.py --- 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)