Closed pmi123 closed 1 year ago
Never mind....operator error. I was putting the DateTimeRangeFilter
in the list_display
by mistake (also has the created
and updated
fields). When I added the DateTimeRangeFilters
to the list_filter
for each model's ModelAdmin
, it all worked as advertised.
I have multiple
ModelAdmin
classes for several models in one admin.py file. Each model has the following two fields:,and each
ModelAdmin
class has the fieldscreated
andupdated
in their respectivelist_filter
lines.I can add the following to one
ModelAdmin
class for one model:But if I try to add the
DateTimeRangeFilter
to anotherModelAdmin
for another model, I get this errorIt gets worse....
In my Django 4.1 project I have multiple apps. Most of all the models in each app have the same two fields for
created
andupdated
. When I try to add theDateTimeRangeFilter
to a different app'sModelAdmin
class for that model'screated
andupdated
fields, I get the same error.Any suggestions on how to fix this?