diff options
Diffstat (limited to 'archaeological_operations/views.py')
-rw-r--r-- | archaeological_operations/views.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py index 1fecce9cd..f295e0f9d 100644 --- a/archaeological_operations/views.py +++ b/archaeological_operations/views.py @@ -36,7 +36,7 @@ from forms import * import models -def autocomplete_patriarche(request, non_closed=True): +def autocomplete_patriarche(request): if (not request.user.has_perm('ishtar_common.view_operation', models.Operation) and not request.user.has_perm('ishtar_common.view_own_operation', @@ -50,8 +50,6 @@ def autocomplete_patriarche(request, non_closed=True): query = Q() for q in q.split(' '): query &= Q(code_patriarche__startswith=q) - if non_closed: - query &= Q(end_date__isnull=True) limit = 15 operations = models.Operation.objects\ .filter(query).order_by('code_patriarche')[:limit] @@ -84,11 +82,12 @@ def autocomplete_archaeologicalsite(request): for site in sites]) return HttpResponse(data, content_type='text/plain') + new_archaeologicalsite = new_item(models.ArchaeologicalSite, ArchaeologicalSiteForm, many=True) -def autocomplete_operation(request, non_closed=True): +def autocomplete_operation(request): # person_types = request.user.ishtaruser.person.person_type if (not request.user.has_perm('ishtar_common.view_operation', models.Operation) @@ -117,8 +116,6 @@ def autocomplete_operation(request, non_closed=True): except ValueError: pass query = query & extra - if non_closed: - query &= Q(end_date__isnull=True) limit = 15 operations = models.Operation.objects.filter(query)[:limit] data = json.dumps([{'id': operation.pk, 'value': unicode(operation)} @@ -136,6 +133,7 @@ def get_available_operation_code(request, year=None): models.Operation.get_available_operation_code(year)}) return HttpResponse(data, content_type='text/plain') + get_operation = get_item(models.Operation, 'get_operation', 'operation') show_operation = show_item(models.Operation, 'operation') @@ -162,11 +160,13 @@ def dashboard_operation(request, *args, **kwargs): dct = {'dashboard': models.OperationDashboard()} return render(request, 'ishtar/dashboards/dashboard_operation.html', dct) + operation_search_wizard = SearchWizard.as_view( [('general-operation_search', OperationFormSelection)], label=_(u"Operation search"), url_name='operation_search',) + wizard_steps = [ ('filechoice-operation_creation', OperationFormFileChoice), ('general-operation_creation', OperationFormGeneral), @@ -195,6 +195,7 @@ def get_check_files_for_operation(other_check=None): return other_check(self) return func + check_files_for_operation = get_check_files_for_operation() |