コード例 #1
0
ファイル: client.py プロジェクト: Jondeen/Bika-LIMS
 def __call__(self):
     base_query = json.loads(self.request['base_query'])
     portal_type = base_query.get('portal_type', [])
     if 'Contact' in portal_type:
         base_query['getParentUID'] = [self.context.UID(),]
     self.request['base_query'] = json.dumps(base_query)
     return DefaultReferenceWidgetVocabulary.__call__(self)
コード例 #2
0
ファイル: ajax.py プロジェクト: redfish2008/bika.lims
 def __call__(self):
     base_query = json.loads(self.request["base_query"])
     portal_type = base_query.get("portal_type", [])
     if "Contact" in portal_type:
         base_query["getParentUID"] = [self.context.UID()]
     self.request["base_query"] = json.dumps(base_query)
     return DefaultReferenceWidgetVocabulary.__call__(self)
コード例 #3
0
 def __call__(self):
     base_query = json.loads(self.request['base_query'])
     portal_type = base_query.get('portal_type', [])
     if 'Contact' in portal_type:
         base_query['getParentUID'] = [self.context.UID(),]
     self.request['base_query'] = json.dumps(base_query)
     return DefaultReferenceWidgetVocabulary.__call__(self)
コード例 #4
0
ファイル: __init__.py プロジェクト: Ammy2/Bika-LIMS
 def __call__(self):
     base_query = json.loads(self.request['base_query'])
     # In client context, restrict samples to client samples only
     if 'portal_type' in base_query \
     and (base_query['portal_type'] == 'Sample'
          or base_query['portal_type'][0] == 'Sample'):
         base_query['getClientUID'] = self.context.aq_parent.UID()
         self.request['base_query'] = json.dumps(base_query)
     return DefaultReferenceWidgetVocabulary.__call__(self)
コード例 #5
0
ファイル: __init__.py プロジェクト: lsizani/Bika-LIMS
 def __call__(self):
     base_query = json.loads(self.request['base_query'])
     # In client context, restrict samples to client samples only
     if 'portal_type' in base_query \
     and (base_query['portal_type'] == 'Sample'
          or base_query['portal_type'][0] == 'Sample'):
         base_query['getClientUID'] = self.context.aq_parent.UID()
         self.request['base_query'] = json.dumps(base_query)
     return DefaultReferenceWidgetVocabulary.__call__(self)
コード例 #6
0
ファイル: __init__.py プロジェクト: redfish2008/bika.lims
 def __call__(self):
     base_query = json.loads(self.request["base_query"])
     # In client context, restrict samples to client samples only
     if "portal_type" in base_query and (
         base_query["portal_type"] == "Sample" or base_query["portal_type"][0] == "Sample"
     ):
         client_uid = self.get_client_uid()
         if client_uid:
             base_query["getClientUID"] = client_uid
             self.request["base_query"] = json.dumps(base_query)
     return DefaultReferenceWidgetVocabulary.__call__(self)
コード例 #7
0
ファイル: ajax.py プロジェクト: xispa/bika.lims
 def __call__(self):
     base_query = json.loads(self.request['base_query'])
     portal_type = base_query.get('portal_type', [])
     if 'Contact' in portal_type:
         base_query['getParentUID'] = [self.context.UID(), ]
         # If ensure_ascii is false, a result may be a unicode instance. This
         # usually happens if the input contains unicode strings or the encoding
         # parameter is used.
         # see: https://github.com/senaite/senaite.core/issues/605
         self.request['base_query'] = json.dumps(base_query, ensure_ascii=False)
     return DefaultReferenceWidgetVocabulary.__call__(self)
コード例 #8
0
 def __call__(self):
     base_query = json.loads(self.request['base_query'])
     portal_type = base_query.get('portal_type', [])
     if 'Contact' in portal_type:
         base_query['getParentUID'] = [
             self.context.UID(),
         ]
         # If ensure_ascii is false, a result may be a unicode instance. This
         # usually happens if the input contains unicode strings or the encoding
         # parameter is used.
         # see: https://github.com/senaite/senaite.core/issues/605
         self.request['base_query'] = json.dumps(base_query,
                                                 ensure_ascii=False)
     return DefaultReferenceWidgetVocabulary.__call__(self)