diff --git a/project/commons/forms.py b/project/commons/forms.py index 50d1b8b..0c07ca0 100644 --- a/project/commons/forms.py +++ b/project/commons/forms.py @@ -65,6 +65,3 @@ class MyBaseModelForm(forms.ModelForm, _MySuperForm): f = self.fields if 'units' in f: f['units'].widget = autocomplete_light.TextWidget('ACMeasure') -# if 'currency' in f: -# f['currency'].widget = autocomplete_light.TextWidget('ACCurrency') - diff --git a/project/docs/autocomplete_light_registry.py b/project/docs/autocomplete_light_registry.py index 7760155..c56cbbe 100644 --- a/project/docs/autocomplete_light_registry.py +++ b/project/docs/autocomplete_light_registry.py @@ -36,11 +36,6 @@ class AutocompleteCurrency(autocomplete_light.AutocompleteModelBase): search_fields = ('name', '^abc_code') -# def choices_for_request(self): -# if not self.request.GET.get('q', '').strip(): -# return self.choices.none() -# return super(AutocompleteCurrency, self).choices_for_request() - autocomplete_light.register(Country, AutocompleteWithEmptyWidget, name='ACCountry') autocomplete_light.register(Currency, AutocompleteCurrency, name='ACCurrency') diff --git a/project/docs/forms/faktura.py b/project/docs/forms/faktura.py index ee9385b..bb7b93c 100644 --- a/project/docs/forms/faktura.py +++ b/project/docs/forms/faktura.py @@ -31,6 +31,7 @@ class FakturaForm(BaseModelForm): _textarea = forms.Textarea(attrs={'cols': 80, 'rows': 3}) widgets = { 'doc_text': _textarea, + 'currency': autocomplete_light.ChoiceWidget('ACCurrency'), }