diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-02-24 17:15:39 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-02-24 17:15:39 +0100 |
commit | 930a01ef1ca7061a45486e6fc2373c7f2d10647f (patch) | |
tree | 656c573a9fe6bcba550d0d87d1290779b8fb93f8 /archaeological_operations/views.py | |
parent | b9ae69e4a58f21baf942ce4e4901d5d973b85bbd (diff) | |
download | Ishtar-930a01ef1ca7061a45486e6fc2373c7f2d10647f.tar.bz2 Ishtar-930a01ef1ca7061a45486e6fc2373c7f2d10647f.zip |
Wizard tests improvements. Test inappropriate parcel deletion.
Diffstat (limited to 'archaeological_operations/views.py')
-rw-r--r-- | archaeological_operations/views.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py index 005fae0db..c4e4acb5e 100644 --- a/archaeological_operations/views.py +++ b/archaeological_operations/views.py @@ -49,9 +49,9 @@ def autocomplete_patriarche(request, non_closed=True): q = request.GET.get('term') query = Q() for q in q.split(' '): - query = query & Q(code_patriarche__startswith=q) + query &= Q(code_patriarche__startswith=q) if non_closed: - query = query & Q(end_date__isnull=True) + query &= Q(end_date__isnull=True) limit = 15 operations = models.Operation.objects\ .filter(query).order_by('code_patriarche')[:limit] @@ -113,12 +113,12 @@ def autocomplete_operation(request, non_closed=True): q = q[2:] try: int(q) - extra = extra | Q(code_patriarche__contains=q) + extra |= Q(code_patriarche__contains=q) except ValueError: pass query = query & extra if non_closed: - query = query & Q(end_date__isnull=True) + query &= Q(end_date__isnull=True) limit = 15 operations = models.Operation.objects.filter(query)[:limit] data = json.dumps([{'id': operation.pk, 'value': unicode(operation)} @@ -215,7 +215,7 @@ operation_creation_wizard = OperationWizard.as_view( condition_dict=ope_crea_condition_dict, url_name='operation_creation',) -operation_modification_wizard = OperationModificationWizard.as_view([ +operation_modif_wizard_steps = [ ('selec-operation_modification', OperationFormSelection), ('general-operation_modification', OperationFormModifGeneral), ('archaeologicalsite-operation_modification', ArchaeologicalSiteFormSet), @@ -229,7 +229,11 @@ operation_modification_wizard = OperationModificationWizard.as_view([ ('periods-operation_modification', PeriodForm), ('relations-operation_modification', RecordRelationsFormSet), ('abstract-operation_modification', OperationFormAbstract), - ('final-operation_modification', FinalForm)], + ('final-operation_modification', FinalForm) +] + +operation_modification_wizard = OperationModificationWizard.as_view( + operation_modif_wizard_steps, label=_(u"Operation modification"), condition_dict={ 'preventive-operation_modification': is_preventive( |