summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-01-05 18:19:06 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-01-05 18:19:06 +0100
commit9f8f172e7e18c9d8fffc5d973f269a50a975d34e (patch)
treef7a78b7b5c988c1c98e588a97eaf1e313ac0d23f /ishtar_common
parent6830c1ba33771fdecca15aeffded5b92aa88775c (diff)
downloadIshtar-9f8f172e7e18c9d8fffc5d973f269a50a975d34e.tar.bz2
Ishtar-9f8f172e7e18c9d8fffc5d973f269a50a975d34e.zip
Better management of context record relations tables (refs #3347)
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/templatetags/window_tables.py4
-rw-r--r--ishtar_common/views.py8
2 files changed, 6 insertions, 6 deletions
diff --git a/ishtar_common/templatetags/window_tables.py b/ishtar_common/templatetags/window_tables.py
index e9f628ab6..fc2ba3874 100644
--- a/ishtar_common/templatetags/window_tables.py
+++ b/ishtar_common/templatetags/window_tables.py
@@ -15,7 +15,7 @@ from ishtar_common.widgets import JQueryJqGrid
from archaeological_files.models import File
from archaeological_operations.models import OperationSource, Operation
from archaeological_context_records.models import ContextRecord, \
- ContextRecordSource, RecordRelations as CRRecordRelations
+ ContextRecordSource, RecordRelationView
from archaeological_finds.models import Find, FindSource, \
FindUpstreamTreatments, FindDownstreamTreatments, FindTreatments
from archaeological_warehouse.models import Container
@@ -41,7 +41,7 @@ ASSOCIATED_MODELS['context_records_docs'] = (
ContextRecordSource,
'get-contextrecordsource', 'get-contextrecordsource-full')
ASSOCIATED_MODELS['context_records_relations'] = (
- CRRecordRelations, 'get-contextrecordrelation', '')
+ RecordRelationView, 'get-contextrecordrelation', '')
ASSOCIATED_MODELS['finds'] = (Find, 'get-find', 'get-find-full')
ASSOCIATED_MODELS['finds_for_ope'] = (
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index d99e7f7ef..5f37a4dbf 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -768,7 +768,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[],
alt_dct = dct.copy()
alt_dct.pop(k)
alt_dct.update(or_req)
- query = query | Q(**alt_dct)
+ query |= Q(**alt_dct)
for rtype_prefix in relation_types:
vals = list(relation_types[rtype_prefix])
@@ -793,8 +793,8 @@ def get_item(model, func_name, default_name, extra_request_keys=[],
if not dct:
# fake condition to trick Django (1.4): without it only the
# alt_dct is managed
- query = query & Q(pk__isnull=False)
- query = query | Q(**alt_dct)
+ query &= Q(pk__isnull=False)
+ query |= Q(**alt_dct)
for k, or_req in or_reqs:
altor_dct = alt_dct.copy()
altor_dct.pop(k)
@@ -805,7 +805,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[],
altor_dct[
rtype_prefix + 'right_relations__right_record__' + j] =\
val
- query = query | Q(**altor_dct)
+ query |= Q(**altor_dct)
if own:
query = query & model.get_query_owns(request.user)