From eb19e57f8afa2cbe6a0bcd0b86345a5d739432de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Koci=C3=A1n?= Date: Fri, 24 Mar 2017 21:21:50 +0100 Subject: [PATCH] =?UTF-8?q?Admin:=20nedovol=20zm=C4=9Bnu=20pdf=20u=20Korek?= =?UTF-8?q?turovan=C3=A9hoPDF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nevěděli bychom, kam přemístit korektury --- korektury/admin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/korektury/admin.py b/korektury/admin.py index 7e74cf27..25b49e4e 100644 --- a/korektury/admin.py +++ b/korektury/admin.py @@ -5,7 +5,14 @@ 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':