From 8c534e377ebc3c79e06fa782e8846139043b4d64 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 6 May 2026 17:12:31 +0200 Subject: ✨ find criteria search - warehouse town of find's containers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/forms_common.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ishtar_common/forms_common.py') diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index d0b1183be..3243214b5 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -95,7 +95,7 @@ from archaeological_finds.models import Find, FindBasket, Treatment, TreatmentFi from archaeological_warehouse.models import Container, Warehouse -def get_town_field(label=_("Town"), required=True): +def get_town_field(label=_("Town"), simple=False, required=True): help_text = _( "

Type name, department code of the " "town you would like to select. The search is insensitive to case." @@ -106,10 +106,9 @@ def get_town_field(label=_("Town"), required=True): "department.

" ) # !FIXME hard_link, reverse_lazy doen't seem to work with formsets + url = "/autocomplete-simple-town" if simple else "/autocomplete-town" return forms.IntegerField( - widget=widgets.JQueryAutoComplete( - "/" + settings.URL_PATH + "autocomplete-town", associated_model=models.Town - ), + widget=widgets.JQueryAutoComplete(url, associated_model=models.Town), validators=[models.valid_id(models.Town)], label=label, help_text=mark_safe(help_text), -- cgit v1.2.3