Browse Source

organizatori | admin | list_display

remotes/origin/vysl
Bc. Petr Pecha 10 years ago
parent
commit
09b8b7c0df
  1. 11
      seminar/admin.py

11
seminar/admin.py

@ -346,7 +346,18 @@ admin.site.register(Novinky, NovinkyAdmin)
### Organizator ### Organizator
def jmeno_organizatora(obj):
return ('%s \"%s\" %s' %
(obj.user.first_name, obj.prezdivka, obj.user.last_name))
jmeno_organizatora.short_description = 'Jméno organizátora'
def je_organizator_aktivni(obj):
return obj.user.is_active
je_organizator_aktivni.short_description = 'Aktivní'
je_organizator_aktivni.boolean = True
@admin.register(Organizator) @admin.register(Organizator)
class OrganizatorAdmin(admin.ModelAdmin): class OrganizatorAdmin(admin.ModelAdmin):
list_filter = ['organizuje_do_roku'] list_filter = ['organizuje_do_roku']
list_display = [jmeno_organizatora, je_organizator_aktivni,]

Loading…
Cancel
Save