server/authentication/models.py
author rougeronj
Thu, 28 May 2015 09:56:40 +0200
changeset 103 b707607e8a38
parent 63 bd7bcfc86232
child 108 4a152f5f4a09
permissions -rw-r--r--
refer to the user model through settings.AUTH_USER_MODEL
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
51
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     1
63
bd7bcfc86232 small update in models : idUser and idArtcle are not required anymore to allow anyone to connect and add a new empty book
rougeronj
parents: 51
diff changeset
     2
from django.contrib.auth.models import AbstractUser
51
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     3
from django.db import models
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     4
103
b707607e8a38 refer to the user model through settings.AUTH_USER_MODEL
rougeronj
parents: 63
diff changeset
     5
import settings
b707607e8a38 refer to the user model through settings.AUTH_USER_MODEL
rougeronj
parents: 63
diff changeset
     6
51
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     7
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     8
class AmmicoUser(AbstractUser):
63
bd7bcfc86232 small update in models : idUser and idArtcle are not required anymore to allow anyone to connect and add a new empty book
rougeronj
parents: 51
diff changeset
     9
    idUser = models.CharField(max_length=50, blank=True)
51
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
    10
    
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
    11
class Profile(models.Model):
103
b707607e8a38 refer to the user model through settings.AUTH_USER_MODEL
rougeronj
parents: 63
diff changeset
    12
    user = models.OneToOneField(settings.AUTH_USER_MODEL)
51
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
    13
    image = models.URLField(max_length=2048, blank=True)