You've already forked STARK
mirror of
https://github.com/MarkParker5/STARK.git
synced 2025-07-02 22:36:54 +02:00
add SmartHome models for db
This commit is contained in:
30
Controls/Django/api/models/User.py
Normal file
30
Controls/Django/api/models/User.py
Normal file
@ -0,0 +1,30 @@
|
||||
import time, datetime
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
|
||||
from django.db import models
|
||||
|
||||
from .UserManager import UserManager
|
||||
|
||||
|
||||
class User(AbstractBaseUser, PermissionsMixin):
|
||||
|
||||
email = models.EmailField(db_index = True, unique = True)
|
||||
is_active = models.BooleanField(default = True)
|
||||
is_staff = models.BooleanField(default = False)
|
||||
created_at = models.DateTimeField(auto_now_add = True)
|
||||
updated_at = models.DateTimeField(auto_now = True)
|
||||
|
||||
USERNAME_FIELD = 'email'
|
||||
REQUIRED_FIELDS = []
|
||||
|
||||
objects = UserManager()
|
||||
|
||||
def get_full_name(self):
|
||||
return self.email
|
||||
|
||||
def get_short_name(self):
|
||||
return self.email
|
||||
|
||||
def __str__(self):
|
||||
return self.email
|
Reference in New Issue
Block a user