X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/b4ededb44a47569b05671f08e95a2fe595732fd4..077f4784b82b151dde0097ed7c2b2aefcf232ea6:/events/admin.py?ds=sidebyside diff --git a/events/admin.py b/events/admin.py index e75c047..b584b6f 100644 --- a/events/admin.py +++ b/events/admin.py @@ -4,15 +4,27 @@ # from django.conf import settings from django.contrib import admin +from fnpdjango.utils.models.translation import translated_fields from events.models import Event -from migdal.helpers import translated_fields class EventAdmin(admin.ModelAdmin): + fieldsets = ( + (None, {'fields': ('date', 'link')}), + ) + tuple( + (ln, {'fields': ( + ('published_%s' % lc), + 'title_%s' % lc, + 'organizer_%s' % lc, + 'place_%s' % lc, + )}) + for lc, ln in settings.LANGUAGES + ) list_display = translated_fields( - ('title', 'place', 'organizer'), settings.LANGUAGES + ('title', 'place', 'organizer', 'published'), settings.LANGUAGES ) + ('date',) date_hierarchy = 'date' + list_filter = translated_fields(('published',)) admin.site.register(Event, EventAdmin)