server/authentication/models.py
author rougeronj
Thu, 02 Apr 2015 11:57:39 +0200
changeset 51 032280909e65
child 63 bd7bcfc86232
permissions -rw-r--r--
add authentication module using Token Auth
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
51
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     1
import json
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     2
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     3
from django.contrib.auth.models import AbstractUser, BaseUserManager
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     4
from django.db import models
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     5
from django.utils import timezone
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     6
import requests
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     7
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     8
from config import URL_JAMESPOT
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
     9
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
    10
class AmmicoUser(AbstractUser):
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
    11
    idUser = models.CharField(max_length=50, unique=True, blank=True)
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
    12
    
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
    13
class Profile(models.Model):
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
    14
    user = models.OneToOneField(AmmicoUser)
032280909e65 add authentication module using Token Auth
rougeronj
parents:
diff changeset
    15
    image = models.URLField(max_length=2048, blank=True)