27 lines
		
	
	
		
			No EOL
		
	
	
		
			693 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			No EOL
		
	
	
		
			693 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| # 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 |