From fbad8873baa680773d6960c5a8719abda0e2bca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benni=20B=C3=A4rmann?= Date: Fri, 9 Dec 2022 16:33:52 +0000 Subject: [PATCH] all service ids are readonly fields now --- input/.models.py.swp | Bin 0 -> 1024 bytes input/admin.py | 6 ++++++ 2 files changed, 6 insertions(+) create mode 100644 input/.models.py.swp diff --git a/input/.models.py.swp b/input/.models.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..b7ad36d7725791f9570a22e76a5936683e1ae43c GIT binary patch literal 1024 zcmYc?$V<%2S1{4DU_b#H0SpXjDM=_|xHxI~sYNM3lvt9Qmz0>7os*cGl#+<4IyXNh WHK$mwpb}GRRAe*+Mnhl#LI407F%c*L literal 0 HcmV?d00001 diff --git a/input/admin.py b/input/admin.py index 2c406ec..08df4ec 100755 --- a/input/admin.py +++ b/input/admin.py @@ -43,6 +43,7 @@ class BusinessCardAdmin(admin.ModelAdmin): list_display_links = ('realname', 'service_id') # action = ['export_as_csv'] date_hierarchy = 'granted_date' + readonly_fields = ['service_id'] class Media: js = ('dropdown/js/base.js',) @@ -53,6 +54,7 @@ class LiteratureAdmin(admin.ModelAdmin): list_display = ('realname', 'service_id', 'granted', 'granted_date') list_display_links = ('realname', 'service_id') date_hierarchy = 'granted_date' + readonly_fields = ['service_id'] @admin.register(Account) @@ -74,6 +76,7 @@ class LibraryAdmin(admin.ModelAdmin): list_display = ('realname', 'service_id', 'granted', 'granted_date') list_display_links = ('realname', 'service_id') date_hierarchy = 'granted_date' + readonly_fields = ['service_id'] @admin.register(IFG) class IFGAdmin(admin.ModelAdmin): @@ -82,6 +85,7 @@ class IFGAdmin(admin.ModelAdmin): list_display = ('realname', 'service_id', 'granted', 'granted_date') list_display_links = ('realname', 'service_id') date_hierarchy = 'granted_date' + readonly_fields = ['service_id'] @admin.register(Travel) class TravelAdmin(admin.ModelAdmin): @@ -101,6 +105,7 @@ class EmailAdmin(admin.ModelAdmin): list_display_links = ('realname', 'service_id') date_hierarchy = 'granted_date' radio_fields = {'adult': admin.VERTICAL} + readonly_fields = ['service_id'] class Media: js = ('dropdown/js/base.js',) @@ -112,6 +117,7 @@ class ListAdmin(admin.ModelAdmin): list_display = ('realname', 'service_id', 'granted', 'granted_date') list_display_links = ('realname', 'service_id') date_hierarchy = 'granted_date' + readonly_fields = ['service_id'] # commented out because of the individual registering to control displays in admin panel