diff options
author | Filipp Lepalaan <filipp@mac.com> | 2021-05-12 23:23:09 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2021-05-12 23:23:09 +0300 |
commit | ac02bb0b5b3abbde7dc0386ad687378eb36eb30a (patch) | |
tree | b5f03ce90400426084386ebe7f077514efec4a73 | |
parent | 8ac4898734ba241bf0a1e7740caccee4c7656480 (diff) | |
download | Servo-ac02bb0b5b3abbde7dc0386ad687378eb36eb30a.tar.gz Servo-ac02bb0b5b3abbde7dc0386ad687378eb36eb30a.tar.bz2 Servo-ac02bb0b5b3abbde7dc0386ad687378eb36eb30a.zip |
Fix widgets for Django 3
-rw-r--r-- | requirements.pip | 2 | ||||
-rw-r--r-- | servo/forms/base.py | 3 | ||||
-rw-r--r-- | servo/forms/orders.py | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/requirements.pip b/requirements.pip index 83da2e4..eb46fe6 100644 --- a/requirements.pip +++ b/requirements.pip @@ -2,6 +2,7 @@ requests django-mptt django-excel django-countries +django-bootstrap3 djangorestframework babel markdown @@ -22,4 +23,3 @@ pyexcel-xlsx pyexcel_text django-wkhtmltopdf -e git+git://github.com/filipp/py-gsxws.git#egg=gsxws --e git+git://github.com/zostera/django-bootstrap3.git#egg=django-bootstrap3 diff --git a/servo/forms/base.py b/servo/forms/base.py index 64c672f..b59215b 100644 --- a/servo/forms/base.py +++ b/servo/forms/base.py @@ -73,7 +73,6 @@ class BaseModelForm(forms.ModelForm): class SearchFieldInput(forms.TextInput): def render(self, name, value, attrs=None): - field = super(SearchFieldInput, self).render(name, value, attrs) final_attrs = self.build_attrs(attrs) @@ -94,7 +93,7 @@ class DatepickerInput(forms.DateInput): kwargs['format'] = "%Y-%m-%d" super(DatepickerInput, self).__init__(*args, **kwargs) - def render(self, name, value, attrs=None): + def render(self, name, value, attrs=None, renderer=None): date_format = "yyyy-MM-dd" diff --git a/servo/forms/orders.py b/servo/forms/orders.py index 7b27d0b..ed58754 100644 --- a/servo/forms/orders.py +++ b/servo/forms/orders.py @@ -152,6 +152,8 @@ class OrderSearchForm(forms.Form): label=_('Status older than (days)'), ) + def __init__(self, request, *args, **kwargs): super(OrderSearchForm, self).__init__(*args, **kwargs) self.fields['location'].queryset = request.user.locations.all() + |