Web M&M
https://mam.matfyz.cz
27 lines
693 B
27 lines
693 B
3 years ago
|
# Nefunkční alternativa vestavěného Usera, který má jméno a mail v přidružené Osobě
|
||
|
# from django.contrib.auth.models import User as Django_User
|
||
|
#
|
||
|
# class Uzivatel(Django_User):
|
||
|
# class Meta:
|
||
|
# proxy = True
|
||
|
#
|
||
|
# @property
|
||
|
# def first_name(self):
|
||
|
# osoby = Osoba.objects.filter(user=self)
|
||
|
# if len(osoby) == 0:
|
||
|
# return None
|
||
|
# return osoby.first().krestni_jmeno
|
||
|
#
|
||
|
# @property
|
||
|
# def last_name(self):
|
||
|
# osoby = Osoba.objects.filter(user=self)
|
||
|
# if len(osoby) == 0:
|
||
|
# return None
|
||
|
# return osoby.first().prijmeni
|
||
|
#
|
||
|
# @property
|
||
|
# def email(self):
|
||
|
# osoby = Osoba.objects.filter(user=self)
|
||
|
# if len(osoby) == 0:
|
||
|
# return None
|
||
|
# return osoby.first().email
|