You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The request to filter the table by multiple search values currently fails if the table contains one or more searchable DateFields or DateTimeFields. This is reproducable with the albums demo table.
During filtering, the list of search values is passed to parse_date(), but that function does not seem to properly account for it and will throw an unavoidable TypeError.
Traceback (most recent call last):
File "/usr/src/app/xxx/views/datatables.py", line 141, in xxx_datatablereturn xxxAjaxDatatableView.as_view()(request)
File "/root/.cache/pypoetry/virtualenvs/non-package-mode-VA82Wl8V-py3.10/lib/python3.10/site-packages/django/views/generic/base.py", line 104, in viewreturnself.dispatch(request, *args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/non-package-mode-VA82Wl8V-py3.10/lib/python3.10/site-packages/django/utils/decorators.py", line 48, in _wrapperreturn bound_method(*args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/non-package-mode-VA82Wl8V-py3.10/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 65, in _view_wrapperreturn view_func(request, *args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/non-package-mode-VA82Wl8V-py3.10/lib/python3.10/site-packages/ajax_datatable/views.py", line 411, in dispatch
response =super(AjaxDatatableView, self).dispatch(request, *args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/non-package-mode-VA82Wl8V-py3.10/lib/python3.10/site-packages/django/views/generic/base.py", line 143, in dispatchreturn handler(request, *args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/non-package-mode-VA82Wl8V-py3.10/lib/python3.10/site-packages/ajax_datatable/views.py", line 514, in postreturnself.get(request, *args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/non-package-mode-VA82Wl8V-py3.10/lib/python3.10/site-packages/ajax_datatable/views.py", line 552, in get
qs =self.prepare_queryset(params, qs)
File "/root/.cache/pypoetry/virtualenvs/non-package-mode-VA82Wl8V-py3.10/lib/python3.10/site-packages/ajax_datatable/views.py", line 821, in prepare_queryset
qs =self.filter_queryset(params, qs)
File "/root/.cache/pypoetry/virtualenvs/non-package-mode-VA82Wl8V-py3.10/lib/python3.10/site-packages/ajax_datatable/views.py", line 831, in filter_queryset
qs =self.filter_queryset_all_columns(params['search_value'], qs)
File "/root/.cache/pypoetry/virtualenvs/non-package-mode-VA82Wl8V-py3.10/lib/python3.10/site-packages/ajax_datatable/views.py", line 897, in filter_queryset_all_columnsreturnself._filter_queryset(searchable_columns, search_value, qs, True)
File "/root/.cache/pypoetry/virtualenvs/non-package-mode-VA82Wl8V-py3.10/lib/python3.10/site-packages/ajax_datatable/views.py", line 880, in _filter_queryset
column_filter = build_column_filter(column_name, column_obj, column_spec, search_value, global_filtering)
File "/root/.cache/pypoetry/virtualenvs/non-package-mode-VA82Wl8V-py3.10/lib/python3.10/site-packages/ajax_datatable/filters.py", line 46, in build_column_filter
parsed_date = parse_date(search_value)
File "/root/.cache/pypoetry/virtualenvs/non-package-mode-VA82Wl8V-py3.10/lib/python3.10/site-packages/ajax_datatable/utils.py", line 131, in parse_date
parsed_date = datetime.datetime.strptime(formatted_date, date_format)
TypeError: strptime() argument 1 must be str, not list
The text was updated successfully, but these errors were encountered:
The request to filter the table by multiple search values currently fails if the table contains one or more searchable
DateFields
orDateTimeFields
. This is reproducable with the albums demo table.During filtering, the list of search values is passed to
parse_date()
, but that function does not seem to properly account for it and will throw an unavoidableTypeError
.django-ajax-datatable/ajax_datatable/filters.py
Line 46 in ac0f4ed
django-ajax-datatable/ajax_datatable/utils.py
Line 131 in ac0f4ed
Stacktrace:
The text was updated successfully, but these errors were encountered: