silentsokolov / django-admin-rangefilter

A Django app that lets you filter data by date range and numeric range in the admin UI
MIT License
721 stars 106 forks source link

Error when i search it #13

Closed joelalves closed 6 years ago

joelalves commented 6 years ago

python 3.5 django 1.11.6 django-admin-rangefilter 0.3.0

Url examplpe = '/voucher/?&date_order__gte=2018-01-01&date_order__lte=2018-01-10'

Problem:

'LocalTimezone' object has no attribute 'localize'

View more details here

silentsokolov commented 6 years ago

@joelalves Tell me what timezone settings (in django) you use

joelalves commented 6 years ago

https://github.com/joelalves/django_erp/blob/master/django_erp/settings/base.py

silentsokolov commented 6 years ago

I could not reproduce the error.

1) What version pytz you using? 2) You using default method get_timezone (code)?

joelalves commented 6 years ago

I am using pytz (2017.3)

  1. Where? The field that use for filter (see here)
silentsokolov commented 6 years ago

Hm ... you sure?

You say that use django 1.11.6, but django.utils.timezone.LocalTimezone remove in 1.11.

joelalves commented 6 years ago

pip_list

Yes, i am sure...You see in image

silentsokolov commented 6 years ago

This is not the environment in which the error occurred. On screen MacOS

joelalves commented 6 years ago

it´s true, but the same environment

silentsokolov commented 6 years ago

Okay, reproduce the error and send the complete log

joelalves commented 6 years ago

ok, tonight i will send the complete log

joelalves commented 6 years ago

It's working after de commit. Thanks You

silentsokolov commented 6 years ago

Of course, this change makes pytz is optional. You do not have pytz, because up to the version django 1.11.X, it is not necessary. Thx for issues.