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)
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)
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)
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)
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)
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)