From fbfc97c926fbf658e740ebc230a04a9a97a0ef5a Mon Sep 17 00:00:00 2001 From: juuso-j <68938778+juuso-j@users.noreply.github.com> Date: Thu, 11 Apr 2024 13:00:00 +0300 Subject: [PATCH] csv_data_source only readonly field. add list_display fields --- eco_counter/admin.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/eco_counter/admin.py b/eco_counter/admin.py index 4a8bd6c82..452689ba5 100644 --- a/eco_counter/admin.py +++ b/eco_counter/admin.py @@ -55,8 +55,16 @@ def get_date(self, obj): class ImportStateAdmin(admin.ModelAdmin): + list_display = ( + "id", + "csv_data_source", + "current_year_number", + "current_month_number", + "current_day_number", + ) + def get_readonly_fields(self, request, obj=None): - return [f.name for f in self.model._meta.fields] + return ["csv_data_source"] class StationAdmin(admin.ModelAdmin):