django-unfold
django-unfold copied to clipboard
RangeDateTimeFilter templete not show date picker
Hi i use the unfould RangeDateTimeFilter for filtering datetime field when i use RangeDateFilter the date picker work fine but when i use RangeDateTimeFilter the datepicker not work
@admin.register(models.Fooo)
class FoooAdmin(BaseAdminModelClass):
list_filter = [
...
("created_at", RangeDateTimeFilter),
]
screanshot
as you see in screenshots when i click on edit, the time filter show up
versions
Django==3.2.20
djangorestframework==3.13.1
django-extensions==3.1.5
django-admin-rangefilter==0.12.0
django-admin-autocomplete-filter==0.7.1
django-cors-headers==3.13.0
django-import-export==3.2.0
django-unfold==0.17.1
I noticed you install django-admin-rangefilter
.
rangefilter
could override unfold's template. Are you using both at the same time?
yes @jrobichaud as you see on myversion section i sed the actual version of my packages. what should i do sir?
I never used unfold
but I used rangefilter
. I was checking the issues to see if it would be compatible with my project, and your issue stood out to me.
Is there a reason you use rangefilter
instead of unfold
's range filters?
From unfold's readme:
# admin.py
from django.contrib import admin
from django.contrib.auth.models import User
from unfold.admin import ModelAdmin
from unfold.contrib.filters.admin import (
RangeDateFilter,
RangeDateTimeFilter,
)
@admin.register(User)
class YourModelAdmin(ModelAdmin):
list_filter_submit = True # Submit button at the bottom of the filter
list_filter = (
("field_E", RangeDateFilter), # Date filter
("field_F", RangeDateTimeFilter), # Datetime filter
)
I would not be surprised they cannot be used together.
My first guess would be to replace the range filters and then remove rangefilter
. Having "rangefilter"
in the INSTALLED_APPS
could result of unintended template overrides, make sure you remove all traces of it.
As I never used unfold
I could be totally wrong.
the unfold datetime filter utility is not my expected result for filtering data
Oh, I understand the point. Maybe you could rename your issue for something like:
"django-admin-rangefilter" compatibility
out of curiosity, what is not expected?
@vahidtwo Unfold has its own range filter. Please check docs for more info.
@lukasvinclav Hi, I am experiencing this issue as well. I have double checked for any conflicting filter libraries and can confirm there are none.
RangeDateFilter works fine, but RangeDateTimeFilter does not allow a date selection:
When clicking the first icon on the left, I get this:
And when clicking the stopwatch icon, it sets the time only, not the date:
EDIT: Adding django and related lib info below:
root@607cf12ec1c2:/app# pip freeze | grep -i django
Django==4.1.13
django-crum==0.7.9
django-dry-rest-permissions==1.2.0
django-extensions==3.2.3
django-rq==2.7.0
django-storages==1.13.2
django-unfold==0.26.0
djangorestframework==3.15.1
pytest-django==4.5.2
@lukasvinclav Hi, I am experiencing this issue as well. I have double checked for any conflicting filter libraries and can confirm there are none.
RangeDateFilter works fine, but RangeDateTimeFilter does not allow a date selection:
When clicking the first icon on the left, I get this:
And when clicking the stopwatch icon, it sets the time only, not the date:
EDIT: Adding django and related lib info below:
root@607cf12ec1c2:/app# pip freeze | grep -i django Django==4.1.13 django-crum==0.7.9 django-dry-rest-permissions==1.2.0 django-extensions==3.2.3 django-rq==2.7.0 django-storages==1.13.2 django-unfold==0.26.0 djangorestframework==3.15.1 pytest-django==4.5.2
me too,I also encountered this problem。