diff --git a/event/models.py b/event/models.py index aaad757..44f17bb 100644 --- a/event/models.py +++ b/event/models.py @@ -1,9 +1,11 @@ -from django.contrib.auth.models import User +from django.contrib.auth import get_user_model from django.utils.translation import ugettext_lazy as _ from django.core.validators import RegexValidator from django.core.exceptions import FieldError from django.db import models +User = get_user_model() + class Event(models.Model): title = models.CharField( diff --git a/users/models.py b/users/models.py index 85206e0..201983c 100644 --- a/users/models.py +++ b/users/models.py @@ -1,2 +1,17 @@ from django.db import models -from django.contrib.auth.models import User +from django.contrib.auth.models import AbstractUser, UserManager +from django.utils.translation import ugettext_lazy as _ + + +class User(AbstractUser): + phone = models.CharField( + _('numéro de téléphone'), + max_length=20, + blank=True, + ) + + objects = UserManager() + + class Meta: + verbose_name = _("utilisateur") + verbose_name_plural = _("utilisateurs")