mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-25 07:50:40 +03:00
23 lines
699 B
Python
23 lines
699 B
Python
from django.contrib.auth.models import AbstractUser
|
|
from django.db.models import CharField
|
|
from django.urls import reverse
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
class User(AbstractUser):
|
|
"""Default user for {{cookiecutter.project_name}}."""
|
|
|
|
#: First and last name do not cover name patterns around the globe
|
|
name = CharField(_("Name of User"), blank=True, max_length=255)
|
|
first_name = None # type: ignore
|
|
last_name = None # type: ignore
|
|
|
|
def get_absolute_url(self):
|
|
"""Get url for user's detail view.
|
|
|
|
Returns:
|
|
str: URL for user detail.
|
|
|
|
"""
|
|
return reverse("users:detail", kwargs={"username": self.username})
|