aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/users/models.py
blob: d1ab662db52c1871ba789c18a95eed844c1fc36d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from django.contrib.auth.models import AbstractUser
from django.db.models import BooleanField, CharField
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _


class User(AbstractUser):

    # First Name and Last Name do not cover name patterns
    # around the globe.
    name = CharField(_("Name of User"), blank=True, max_length=255)
    is_person = BooleanField(default=False)

    def get_absolute_url(self):
        return reverse("users:detail", kwargs={"username": self.username})