Models: neúspěšný (zakomentovaný) pokus o vlastního Usera
This commit is contained in:
parent
81d868eb06
commit
1f789f6ad0
1 changed files with 32 additions and 0 deletions
|
@ -1587,3 +1587,35 @@ class Novinky(models.Model):
|
|||
return '[' + str(self.datum) + '] ' + self.text[0:50]
|
||||
else:
|
||||
return '[' + str(self.datum) + '] '
|
||||
|
||||
|
||||
|
||||
|
||||
# FIXME: Tohle nepatří do aplikace 'seminar'
|
||||
# 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
|
||||
|
|
Loading…
Reference in a new issue