Web M&M
https://mam.matfyz.cz
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
758 B
26 lines
758 B
from django.contrib import admin
|
|
from reversion.admin import VersionAdmin
|
|
from korektury.models import KorekturovanePDF
|
|
|
|
|
|
# Register your models here.
|
|
class KorekturovanePDFAdmin(VersionAdmin):
|
|
|
|
readonly_fields = ['cas', 'stran']
|
|
|
|
def get_readonly_fields(self, request, obj=None):
|
|
if obj:
|
|
return self.readonly_fields + ['pdf']
|
|
return self.readonly_fields
|
|
|
|
fieldsets = [
|
|
(None,
|
|
{'fields':
|
|
['pdf', 'cas', 'org', 'stran', 'nazev', 'komentar']}),
|
|
# (u'PDF', {'fields': ['pdf']}),
|
|
]
|
|
list_display = ['nazev', 'cas', 'stran', 'org']
|
|
list_filter = []
|
|
search_fields = []
|
|
|
|
admin.site.register(KorekturovanePDF, KorekturovanePDFAdmin)
|
|
|