Admin: Fix ResitelInline
This commit is contained in:
parent
3007ac3433
commit
6142f4a979
1 changed files with 11 additions and 2 deletions
|
@ -76,11 +76,20 @@ def create_modeladmin(modeladmin, model, name = None, verbose_name = None, verbo
|
|||
|
||||
class ResitelInline(admin.TabularInline):
|
||||
model = Resitel
|
||||
fields = ['jmeno', 'prijmeni', 'skola', 'mesto', 'rok_maturity', ]
|
||||
readonly_fields = ['jmeno', 'prijmeni', 'skola', 'mesto', 'rok_maturity', ]
|
||||
fields = ['osoba_jmeno', 'osoba_prijmeni', 'skola', 'osoba_mesto', 'rok_maturity', ]
|
||||
readonly_fields = ['osoba_jmeno', 'osoba_prijmeni', 'skola', 'osoba_mesto', 'rok_maturity', ]
|
||||
extra = 0
|
||||
view_on_site = False
|
||||
|
||||
def osoba_jmeno(self, obj):
|
||||
return obj.osoba.jmeno
|
||||
|
||||
def osoba_prijmeni(self, obj):
|
||||
return obj.osoba.prijmeni
|
||||
|
||||
def osoba_mesto(self, obj):
|
||||
return obj.osoba.mesto
|
||||
|
||||
def has_add_permission(self, req): return False
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue