diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-11-30 18:47:14 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-11-30 18:48:21 +0100 |
commit | f5f97fb1d89a4ccfc0219c17aa3e8bac6f7fd357 (patch) | |
tree | e091e17882ca67be8e6040e938439fa5a5e6bc5a /archaeological_finds/forms_treatments.py | |
parent | 0493613840e21a9b72ea6d9d5eaa90968dc7f472 (diff) | |
download | Ishtar-f5f97fb1d89a4ccfc0219c17aa3e8bac6f7fd357.tar.bz2 Ishtar-f5f97fb1d89a4ccfc0219c17aa3e8bac6f7fd357.zip |
Manage basket to treatment file association
Diffstat (limited to 'archaeological_finds/forms_treatments.py')
-rw-r--r-- | archaeological_finds/forms_treatments.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/archaeological_finds/forms_treatments.py b/archaeological_finds/forms_treatments.py index be53dd418..4f120adbf 100644 --- a/archaeological_finds/forms_treatments.py +++ b/archaeological_finds/forms_treatments.py @@ -26,7 +26,7 @@ from django.core import validators from django.forms.formsets import formset_factory from django.utils.translation import ugettext_lazy as _ -import models +from archaeological_finds import models from archaeological_operations.forms import AdministrativeActForm, \ AdministrativeActOpeFormSelection, AdministrativeActModifForm from archaeological_operations.models import ActType, AdministrativeAct @@ -125,7 +125,6 @@ class BaseTreatmentForm(CustomForm, ManageOldType): max_length=200, required=False) other_reference = forms.CharField( label=_(u"Other ref."), max_length=200, required=False) - # target_is_basket = forms.NullBooleanField(label=_(u"Target")) # external_id = forms.CharField( # label=_(u"External ref."), max_length=200, required=False) start_date = forms.DateField(label=_(u"Start date"), required=False, @@ -570,7 +569,9 @@ class TreatmentFileForm(ManageOldType): base_models = ['treatment_type_type'] associated_models = { 'type': models.TreatmentFileType, 'in_charge': Person, - 'applicant': Person, 'applicant_organisation': Organization} + 'applicant': Person, 'applicant_organisation': Organization, + 'associated_basket': models.FindBasket + } need_user_for_initialization = True name = forms.CharField(label=_(u"Name"), @@ -603,6 +604,11 @@ class TreatmentFileForm(ManageOldType): reverse_lazy('autocomplete-organization'), associated_model=Organization, new=True), validators=[valid_id(Organization)], required=False) + associated_basket = forms.IntegerField( + _(u"Associated basket"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-findbasket'), + associated_model=models.FindBasket), required=False) comment = forms.CharField(label=_(u"Comment"), widget=forms.Textarea, required=False) creation_date = forms.DateField(label=_(u"Start date"), required=False, |