Browse Source

Admin: Fix ResitelInline

export_seznamu_prednasek
LEdoian 6 years ago
parent
commit
6142f4a979
  1. 13
      seminar/admin.py

13
seminar/admin.py

@ -76,11 +76,20 @@ def create_modeladmin(modeladmin, model, name = None, verbose_name = None, verbo
class ResitelInline(admin.TabularInline): class ResitelInline(admin.TabularInline):
model = Resitel model = Resitel
fields = ['jmeno', 'prijmeni', 'skola', 'mesto', 'rok_maturity', ] fields = ['osoba_jmeno', 'osoba_prijmeni', 'skola', 'osoba_mesto', 'rok_maturity', ]
readonly_fields = ['jmeno', 'prijmeni', 'skola', 'mesto', 'rok_maturity', ] readonly_fields = ['osoba_jmeno', 'osoba_prijmeni', 'skola', 'osoba_mesto', 'rok_maturity', ]
extra = 0 extra = 0
view_on_site = False 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 def has_add_permission(self, req): return False

Loading…
Cancel
Save