2015-12-01 22:18:28 +01:00
|
|
|
from django.contrib import admin
|
2015-12-05 01:19:49 +01:00
|
|
|
from reversion.admin import VersionAdmin
|
|
|
|
from korektury.models import KorekturovanePDF
|
2015-12-01 22:18:28 +01:00
|
|
|
|
2016-10-02 11:17:32 +02:00
|
|
|
|
2015-12-01 22:18:28 +01:00
|
|
|
# Register your models here.
|
2015-12-05 01:19:49 +01:00
|
|
|
class KorekturovanePDFAdmin(VersionAdmin):
|
2017-03-24 21:21:50 +01:00
|
|
|
|
2019-05-11 01:15:05 +02:00
|
|
|
readonly_fields = ['cas', 'stran']
|
2017-03-24 21:21:50 +01:00
|
|
|
|
2019-05-11 01:15:05 +02:00
|
|
|
def get_readonly_fields(self, request, obj=None):
|
|
|
|
if obj:
|
|
|
|
return self.readonly_fields + ['pdf']
|
|
|
|
return self.readonly_fields
|
2017-03-24 21:21:50 +01:00
|
|
|
|
2019-05-11 01:15:05 +02:00
|
|
|
fieldsets = [
|
|
|
|
(None,
|
|
|
|
{'fields':
|
|
|
|
['pdf', 'cas', 'org', 'stran', 'nazev', 'komentar']}),
|
|
|
|
# (u'PDF', {'fields': ['pdf']}),
|
|
|
|
]
|
|
|
|
list_display = ['nazev', 'cas', 'stran', 'org']
|
|
|
|
list_filter = []
|
|
|
|
search_fields = []
|
2016-10-02 11:17:32 +02:00
|
|
|
|
2015-12-05 01:19:49 +01:00
|
|
|
admin.site.register(KorekturovanePDF, KorekturovanePDFAdmin)
|