from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.

class User(AbstractUser):
    email= models.EmailField(verbose_name="email", max_length=254,unique=True)
    username=models.CharField(max_length=22, null=True, blank=True)
    phone = models.CharField(max_length=12, null=True, blank=True)
    REQUIRED_FIELDS = ['username','phone','first_name','last_name']
    USERNAME_FIELD ='email'


    def get_username(self):
        return self.email