diff options
Diffstat (limited to 'archaeological_finds/forms.py')
-rw-r--r-- | archaeological_finds/forms.py | 97 |
1 files changed, 25 insertions, 72 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index 78a415abf..854430c2c 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -55,29 +55,31 @@ from archaeological_finds.forms_treatments import TreatmentSelect, \ AdministrativeActTreatmentModifForm, \ AdministrativeActTreatmentFileForm, \ AdministrativeActTreatmentFileFormSelection, \ - AdministrativeActTreatmentFileModifForm - -__all__ = ['TreatmentSelect', 'TreatmentFormSelection', 'BaseTreatmentForm', - 'ModifyTreatmentForm', 'AdministrativeActTreatmentForm', - 'TreatmentFormFileChoice', 'TreatmentDeletionForm', - 'AdministrativeActTreatmentModifForm', - 'TreatmentFileSelect', 'TreatmentFileFormSelection', - 'TreatmentFileForm', 'ModifyTreatmentFileForm', - 'TreatmentFileDeletionForm', 'AdministrativeActTreatmentFileForm', - 'AdministrativeActTreatmentFileFormSelection', - 'AdministrativeActTreatmentFormSelection', - 'AdministrativeActTreatmentFileModifForm', - 'RecordFormSelection', - 'FindForm', 'DateForm', 'DatingFormSet', 'FindSelect', - 'FindFormSelection', 'MultipleFindFormSelection', - 'FindMultipleFormSelection', 'check_form', 'check_exist', - 'check_not_exist', 'check_value', 'check_type_field', - 'check_type_not_field', 'check_treatment', 'ResultFindForm', - 'ResultFindFormSet', 'FindDeletionForm', - 'UpstreamFindFormSelection', 'SourceFindFormSelection', - 'FindSourceSelect', 'FindSourceFormSelection', - 'NewFindBasketForm', 'SelectFindBasketForm', 'DeleteFindBasketForm', - 'FindBasketAddItemForm'] + AdministrativeActTreatmentFileModifForm, SourceTreatmentFormSelection, \ + SourceTreatmentFileFormSelection, TreatmentSourceFormSelection, \ + TreatmentFileSourceFormSelection + +__all__ = [ + 'TreatmentSelect', 'TreatmentFormSelection', 'BaseTreatmentForm', + 'ModifyTreatmentForm', 'AdministrativeActTreatmentForm', + 'TreatmentFormFileChoice', 'TreatmentDeletionForm', + 'AdministrativeActTreatmentModifForm', 'TreatmentFileSelect', + 'TreatmentFileFormSelection', 'TreatmentFileForm', + 'ModifyTreatmentFileForm', 'TreatmentFileDeletionForm', + 'AdministrativeActTreatmentFileForm', + 'AdministrativeActTreatmentFileFormSelection', + 'AdministrativeActTreatmentFormSelection', + 'AdministrativeActTreatmentFileModifForm', 'SourceTreatmentFormSelection', + 'SourceTreatmentFileFormSelection', 'TreatmentSourceFormSelection', + 'TreatmentFileSourceFormSelection', + 'RecordFormSelection', 'FindForm', 'DateForm', 'DatingFormSet', + 'FindSelect', 'FindFormSelection', 'MultipleFindFormSelection', + 'FindMultipleFormSelection', 'check_form', 'check_exist', 'check_not_exist', + 'check_value', 'check_type_field', 'check_type_not_field', + 'check_treatment', 'ResultFindForm', 'ResultFindFormSet', + 'FindDeletionForm', 'UpstreamFindFormSelection', 'SourceFindFormSelection', + 'FindSourceSelect', 'FindSourceFormSelection', 'NewFindBasketForm', + 'SelectFindBasketForm', 'DeleteFindBasketForm', 'FindBasketAddItemForm'] logger = logging.getLogger(__name__) @@ -633,52 +635,3 @@ class FindBasketAddItemForm(forms.Form): raise PermissionDenied basket.items.add(item) return basket - - -""" -#################################### -# Source management for treatments # -#################################### - -SourceTreatementFormSelection = get_form_selection( - 'SourceTreatmentFormSelection', _(u"Treatment search"), 'operation', - models.Treatment, TreatmentSelect, 'get-treatment', - _(u"You should select a treatment.")) - -class TreatmentSourceSelect(SourceSelect): - operation__towns = get_town_field(label=_(u"Operation's town")) - treatment__treatment_type = forms.ChoiceField(label=_(u"Operation type"), - choices=[]) - operation__year = forms.IntegerField(label=_(u"Operation's year")) - - def __init__(self, *args, **kwargs): - super(OperationSourceSelect, self).__init__(*args, **kwargs) - self.fields['operation__operation_type'].choices = \ - OperationType.get_types() - self.fields['operation__operation_type'].help_text = \ - OperationType.get_help() - -""" - -""" -OperationSourceFormSelection = get_form_selection( - 'OperationSourceFormSelection', _(u"Documentation search"), 'pk', - models.OperationSource, OperationSourceSelect, 'get-operationsource', - _(u"You should select a document.")) - -operation_source_modification_wizard = OperationSourceWizard([ - ('selec-operation_source_modification', OperationSourceFormSelection), - ('source-operation_source_modification', SourceForm), - ('authors-operation_source_modification', AuthorFormset), - ('final-operation_source_modification', FinalForm)], - url_name='operation_source_modification',) - -class OperationSourceDeletionWizard(DeletionWizard): - model = models.OperationSource - fields = ['operation', 'title', 'source_type', 'authors',] - -operation_source_deletion_wizard = OperationSourceDeletionWizard([ - ('selec-operation_source_deletion', OperationSourceFormSelection), - ('final-operation_source_deletion', SourceDeletionForm)], - url_name='operation_source_deletion',) -""" |