organizatori | admin | list_display
This commit is contained in:
parent
da64ec12a0
commit
09b8b7c0df
1 changed files with 11 additions and 0 deletions
|
@ -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…
Reference in a new issue