# Path: accounts/models.py
# class WhaleUser(User, AbstractBaseUser):
#     objects = WhaleUserManager()
#     email = models.EmailField(verbose_name=_('Email address *'), max_length=255, unique=True)
#     is_active = models.BooleanField(default=True)
#     is_admin = models.BooleanField(default=False)
# 
# 
#     USERNAME_FIELD = 'email'
#     REQUIRED_FIELDS = ['nickname']
# 
#     def get_full_name(self):
#         return self.nickname
# 
#     def get_short_name(self):
#         return self.nickname
# 
#     def __str__(self):             
#         return self.nickname
# 
# class User(PolymorphicModel):
# 
#     id = models.CharField(max_length=100, primary_key=True, default=uuid.uuid4, editable=False)
#     nickname = models.CharField(verbose_name=_('Nickname *'), max_length=30)
# 
# Path: accounts/models.py
# class WhaleUser(User, AbstractBaseUser):
#     objects = WhaleUserManager()
#     email = models.EmailField(verbose_name=_('Email address *'), max_length=255, unique=True)
#     is_active = models.BooleanField(default=True)
#     is_admin = models.BooleanField(default=False)
# 
# 
#     USERNAME_FIELD = 'email'
#     REQUIRED_FIELDS = ['nickname']
# 
#     def get_full_name(self):
#         return self.nickname
# 
#     def get_short_name(self):
#         return self.nickname
# 
#     def __str__(self):             
#         return self.nickname


import uuid
from datetime import date, timedelta
from django.db import models
from accounts.models import WhaleUser,User
from django.utils.translation import ugettext_lazy as _
from polymorphic.models import PolymorphicModel
from django.contrib.contenttypes.models import ContentType
from accounts.models import WhaleUser
# -*- coding: utf-8 -*-

class Poll(PolymorphicModel):
    id = models.CharField(max_length=100, primary_key=True, default=uuid.uuid4, editable=False)
    title = models.CharField(max_length=250,verbose_name= _("title *"))
    description = models.TextField(blank=True,null=True,verbose_name= _("description"))
    creation_date = models.DateField(auto_now_add=True)
    closing_date = models.DateField(default=date.today()+timedelta(days=1000),verbose_name= _("closing date * "))

# Path: accounts/models.py
# class WhaleUser(User, AbstractBaseUser):
#     objects = WhaleUserManager()
#     email = models.EmailField(verbose_name=_('Email address *'), max_length=255, unique=True)
#     is_active = models.BooleanField(default=True)
#     is_admin = models.BooleanField(default=False)
# 
# 
#     USERNAME_FIELD = 'email'
#     REQUIRED_FIELDS = ['nickname']
# 
#     def get_full_name(self):
#         return self.nickname
# 
#     def get_short_name(self):
#         return self.nickname
# 
#     def __str__(self):             
#         return self.nickname
# 
# class User(PolymorphicModel):
# 
#     id = models.CharField(max_length=100, primary_key=True, default=uuid.uuid4, editable=False)
#     nickname = models.CharField(verbose_name=_('Nickname *'), max_length=30)
# 
# Path: accounts/models.py
# class WhaleUser(User, AbstractBaseUser):
#     objects = WhaleUserManager()
#     email = models.EmailField(verbose_name=_('Email address *'), max_length=255, unique=True)
#     is_active = models.BooleanField(default=True)
#     is_admin = models.BooleanField(default=False)
# 
# 
#     USERNAME_FIELD = 'email'
#     REQUIRED_FIELDS = ['nickname']
# 
#     def get_full_name(self):
#         return self.nickname
# 
#     def get_short_name(self):
#         return self.nickname
# 
#     def __str__(self):             
#         return self.nickname


# Path: polls/models.py
import uuid
from datetime import date, timedelta
from django.db import models
from accounts.models import WhaleUser,User
from django.utils.translation import ugettext_lazy as _
from polymorphic.models import PolymorphicModel
from django.contrib.contenttypes.models import ContentType
from accounts.models import WhaleUser

# -*- coding: utf-8 -*-

class Poll(PolymorphicModel):
    id = models.CharField(max_length=100, primary_key=True, default=uuid.uuid4, editable=False)
    title = models.CharField(max_length=250,verbose_name= _("title *"))
    description = models.TextField(blank=True,null=True,verbose_name= _("description"))
    creation_date = models.DateField(auto_now_add=True)
    closing_date = models.DateField(default=date.today()+timedelta(days=1000),verbose_name= _("closing date * "))

    admin = models.ForeignKey(WhaleUser, on_delete=models.CASCADE,related_name='polls')