Last active
August 26, 2020 13:36
-
-
Save mentix02/76c4c24d41792ce1876d3229478c40a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.contrib.auth.models import AbstractUser | |
from django.utils.translation import gettext_lazy as _ | |
class User(AbstractUser): | |
private = models.BooleanField(default=False) | |
email = models.EmailField(_('email address'), unique=True) | |
bio = models.CharField( | |
max_length=250, null=True, blank=True, help_text='About the user.' | |
) | |
picture = models.ImageField( | |
null=True, | |
blank=True, | |
default='default.png', | |
upload_to='profile_pictures', | |
verbose_name=_('profile picture'), | |
) | |
REQUIRED_FIELDS = ['email', 'password'] | |
def __str__(self) -> str: | |
return self.username |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment