# Path: django/contrib/aderit/access_account/models.py
# class AccessAccount(models.Model):
#     user = models.OneToOneField(User)
#     token = models.CharField(max_length=128, blank=True)
# 
#     class Meta:
#         abstract = True
#         ordering = ["user"]
# 
#     def __unicode__(self):
#         return self.user.username
# 
#     def save(self, force_insert=False, force_update=False, using=None):
#         if self.pk is not None:
#             self.user.save(force_insert=force_insert,
#                            force_update=force_update,
#                            using=using)
#         super(AccessAccount, self).save(force_insert=force_insert,
#                                         force_update=force_update, using=using)
# 
#     def _set_username(self, value):
#         self.user.username = value
# 
#     def _get_username(self):
#         return self.user.username
# 
#     username = property(_get_username, _set_username)
# 
#     def _set_email(self, value):
#         self.user.email = value
# 
#     def _get_email(self):
#         return self.user.email
# 
#     email = property(_get_email, _set_email)
# 
#     def _set_firstname(self, value):
#         self.user.first_name = value
# 
#     def _get_firstname(self):
#         return self.user.first_name
# 
#     firstname = property(_get_firstname, _set_firstname)
# 
#     def _set_lastname(self, value):
#         self.user.last_name = value
# 
#     def _get_lastname(self):
#         return self.user.last_name
# 
#     lastname = property(_get_lastname, _set_lastname)
# 
#     @property
#     def fullname(self):
#         _fullname = ""
#         if self.firstname != "":
#             _fullname += self.firstname
#         if self.lastname != "":
#             _fullname += " " + self.lastname
#         if _fullname == "":
#             _fullname = self.username
#         return _fullname
# 
#     def _set_is_staff(self, value):
#         self.user.is_staff = value
# 
#     def _get_is_staff(self):
#         return self.user.is_staff
# 
#     is_staff = property(_get_is_staff, _set_is_staff)
# 
#     def _set_is_admin(self, value):
#         self.user.is_admin = value
# 
#     def _get_is_admin(self):
#         return self.user.is_admin
# 
#     is_admin = property(_get_is_admin, _set_is_admin)
# 
#     def _set_is_active(self, value):
#         self.user.is_active = value
# 
#     def _get_is_active(self):
#         return self.user.is_active
# 
#     is_active = property(_get_is_active, _set_is_active)
# 
#     @property
#     def usergroups(self):
#         return self.user.groups.all()
# 
#     @property
#     def userpermissions(self):
#         return self.user.user_permissions.all()
# 
#     @property
#     def last_login(self):
#         return self.user.last_login
# 
#     @property
#     def date_joined(self):
#         return self.user.date_joined
# 
# Path: django/contrib/aderit/generic_utils/models/fields.py
# class GenericPhoneField(CharField):
#     description = _("Phone number")
# 
#     def formfield(self, **kwargs):
#         defaults = {
#             'form_class': forms_fields.GenericPhoneField
#         }
#         defaults.update(kwargs)
#         return super(GenericPhoneField, self).formfield(**defaults)


from django.conf import settings
from django.db.models import fields as models_fields
from django.contrib.auth.models import User
from django.core.validators import RegexValidator
from django.utils.log import getLogger
from django.utils.translation import ugettext_lazy as _
from django.contrib.aderit.access_account.models import AccessAccount
from django.contrib.aderit.generic_utils.models.fields import \
    GenericPhoneField as PhoneField
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :


logger = getLogger('account.models')


### User Profile Model
class Account(AccessAccount):
    phone = PhoneField(_("Phone"), max_length=125, blank=True)  # home phone

# Path: django/contrib/aderit/access_account/models.py
# class AccessAccount(models.Model):
#     user = models.OneToOneField(User)
#     token = models.CharField(max_length=128, blank=True)
# 
#     class Meta:
#         abstract = True
#         ordering = ["user"]
# 
#     def __unicode__(self):
#         return self.user.username
# 
#     def save(self, force_insert=False, force_update=False, using=None):
#         if self.pk is not None:
#             self.user.save(force_insert=force_insert,
#                            force_update=force_update,
#                            using=using)
#         super(AccessAccount, self).save(force_insert=force_insert,
#                                         force_update=force_update, using=using)
# 
#     def _set_username(self, value):
#         self.user.username = value
# 
#     def _get_username(self):
#         return self.user.username
# 
#     username = property(_get_username, _set_username)
# 
#     def _set_email(self, value):
#         self.user.email = value
# 
#     def _get_email(self):
#         return self.user.email
# 
#     email = property(_get_email, _set_email)
# 
#     def _set_firstname(self, value):
#         self.user.first_name = value
# 
#     def _get_firstname(self):
#         return self.user.first_name
# 
#     firstname = property(_get_firstname, _set_firstname)
# 
#     def _set_lastname(self, value):
#         self.user.last_name = value
# 
#     def _get_lastname(self):
#         return self.user.last_name
# 
#     lastname = property(_get_lastname, _set_lastname)
# 
#     @property
#     def fullname(self):
#         _fullname = ""
#         if self.firstname != "":
#             _fullname += self.firstname
#         if self.lastname != "":
#             _fullname += " " + self.lastname
#         if _fullname == "":
#             _fullname = self.username
#         return _fullname
# 
#     def _set_is_staff(self, value):
#         self.user.is_staff = value
# 
#     def _get_is_staff(self):
#         return self.user.is_staff
# 
#     is_staff = property(_get_is_staff, _set_is_staff)
# 
#     def _set_is_admin(self, value):
#         self.user.is_admin = value
# 
#     def _get_is_admin(self):
#         return self.user.is_admin
# 
#     is_admin = property(_get_is_admin, _set_is_admin)
# 
#     def _set_is_active(self, value):
#         self.user.is_active = value
# 
#     def _get_is_active(self):
#         return self.user.is_active
# 
#     is_active = property(_get_is_active, _set_is_active)
# 
#     @property
#     def usergroups(self):
#         return self.user.groups.all()
# 
#     @property
#     def userpermissions(self):
#         return self.user.user_permissions.all()
# 
#     @property
#     def last_login(self):
#         return self.user.last_login
# 
#     @property
#     def date_joined(self):
#         return self.user.date_joined
# 
# Path: django/contrib/aderit/generic_utils/models/fields.py
# class GenericPhoneField(CharField):
#     description = _("Phone number")
# 
#     def formfield(self, **kwargs):
#         defaults = {
#             'form_class': forms_fields.GenericPhoneField
#         }
#         defaults.update(kwargs)
#         return super(GenericPhoneField, self).formfield(**defaults)


# Path: project_template/account/models.py
from django.conf import settings
from django.db.models import fields as models_fields
from django.contrib.auth.models import User
from django.core.validators import RegexValidator
from django.utils.log import getLogger
from django.utils.translation import ugettext_lazy as _
from django.contrib.aderit.access_account.models import AccessAccount
from django.contrib.aderit.generic_utils.models.fields import \
    GenericPhoneField as PhoneField

# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :


logger = getLogger('account.models')


### User Profile Model
class Account(AccessAccount):
    phone = PhoneField(_("Phone"), max_length=125, blank=True)  # home phone

    mobile_phone = PhoneField(_("Mobile Phone"), max_length=125, blank=True)  # mobile phone