def describeSObjects(self, sObjectTypes): res = BaseClient.describeSObjects(self, sObjectTypes) if type(res) not in (TupleType, ListType): res = [res] data = list() for r in res: d = dict() d['activateable'] = _bool(r[_tPartnerNS.activateable]) rawreldata = r[_tPartnerNS.ChildRelationships:] relinfo = [_extractChildRelInfo(cr) for cr in rawreldata] d['ChildRelationships'] = relinfo d['createable'] = _bool(r[_tPartnerNS.createable]) d['custom'] = _bool(r[_tPartnerNS.custom]) try: d['customSetting'] = _bool(r[_tPartnerNS.customSetting]) except KeyError: pass d['deletable'] = _bool(r[_tPartnerNS.deletable]) d['deprecatedAndHidden'] = _bool( r[_tPartnerNS.deprecatedAndHidden]) try: d['feedEnabled'] = _bool(r[_tPartnerNS.feedEnabled]) except KeyError: pass fields = r[_tPartnerNS.fields:] fields = [_extractFieldInfo(f) for f in fields] field_map = dict() for f in fields: field_map[f.name] = f d['fields'] = field_map d['keyPrefix'] = str(r[_tPartnerNS.keyPrefix]) d['label'] = str(r[_tPartnerNS.label]) d['labelPlural'] = str(r[_tPartnerNS.labelPlural]) d['layoutable'] = _bool(r[_tPartnerNS.layoutable]) d['mergeable'] = _bool(r[_tPartnerNS.mergeable]) d['name'] = str(r[_tPartnerNS.name]) d['queryable'] = _bool(r[_tPartnerNS.queryable]) d['recordTypeInfos'] = [ _extractRecordTypeInfo(rti) for rti in r[_tPartnerNS.recordTypeInfos:] ] d['replicateable'] = _bool(r[_tPartnerNS.replicateable]) d['retrieveable'] = _bool(r[_tPartnerNS.retrieveable]) d['searchable'] = _bool(r[_tPartnerNS.searchable]) try: d['triggerable'] = _bool(r[_tPartnerNS.triggerable]) except KeyError: pass d['undeletable'] = _bool(r[_tPartnerNS.undeletable]) d['updateable'] = _bool(r[_tPartnerNS.updateable]) d['urlDetail'] = str(r[_tPartnerNS.urlDetail]) d['urlEdit'] = str(r[_tPartnerNS.urlEdit]) d['urlNew'] = str(r[_tPartnerNS.urlNew]) data.append(SObject(**d)) return data
def describeSObjects(self, sObjectTypes): res = BaseClient.describeSObjects(self, sObjectTypes) if type(res) not in (TupleType, ListType): res = [res] data = list() for r in res: d = dict() d['activateable'] = _bool(r[_tPartnerNS.activateable]) rawreldata = r[_tPartnerNS.ChildRelationships:] relinfo = [_extractChildRelInfo(cr) for cr in rawreldata] d['ChildRelationships'] = relinfo d['createable'] = _bool(r[_tPartnerNS.createable]) d['custom'] = _bool(r[_tPartnerNS.custom]) try: d['customSetting'] = _bool(r[_tPartnerNS.customSetting]) except KeyError: pass d['deletable'] = _bool(r[_tPartnerNS.deletable]) d['deprecatedAndHidden'] = _bool(r[_tPartnerNS.deprecatedAndHidden]) try: d['feedEnabled'] = _bool(r[_tPartnerNS.feedEnabled]) except KeyError: pass fields = r[_tPartnerNS.fields:] fields = [_extractFieldInfo(f) for f in fields] field_map = dict() for f in fields: field_map[f.name] = f d['fields'] = field_map d['keyPrefix'] = str(r[_tPartnerNS.keyPrefix]) d['label'] = str(r[_tPartnerNS.label]) d['labelPlural'] = str(r[_tPartnerNS.labelPlural]) d['layoutable'] = _bool(r[_tPartnerNS.layoutable]) d['mergeable'] = _bool(r[_tPartnerNS.mergeable]) d['name'] = str(r[_tPartnerNS.name]) d['queryable'] = _bool(r[_tPartnerNS.queryable]) d['recordTypeInfos'] = [_extractRecordTypeInfo(rti) for rti in r[_tPartnerNS.recordTypeInfos:]] d['replicateable'] = _bool(r[_tPartnerNS.replicateable]) d['retrieveable'] = _bool(r[_tPartnerNS.retrieveable]) d['searchable'] = _bool(r[_tPartnerNS.searchable]) try: d['triggerable'] = _bool(r[_tPartnerNS.triggerable]) except KeyError: pass d['undeletable'] = _bool(r[_tPartnerNS.undeletable]) d['updateable'] = _bool(r[_tPartnerNS.updateable]) d['urlDetail'] = str(r[_tPartnerNS.urlDetail]) d['urlEdit'] = str(r[_tPartnerNS.urlEdit]) d['urlNew'] = str(r[_tPartnerNS.urlNew]) data.append(SObject(**d)) return data
def describeSObjects(self, sObjectTypes): if (self.describeCache.has_key(sObjectTypes)): data = list() data.append(self.describeCache[sObjectTypes]) return data res = BaseClient.describeSObjects(self, sObjectTypes) if type(res) not in (TupleType, ListType): res = [res] data = list() for r in res: d = dict() d['activateable'] = _bool(r[_tPartnerNS.activateable]) d['createable'] = _bool(r[_tPartnerNS.createable]) d['custom'] = _bool(r[_tPartnerNS.custom]) d['deletable'] = _bool(r[_tPartnerNS.deletable]) fields = r[_tPartnerNS.fields:] fields = [_extractFieldInfo(f) for f in fields] field_map = dict() for f in fields: field_map[f.name] = f d['fields'] = field_map rawreldata = r[_tPartnerNS.ChildRelationships:] # why is this list empty ? # print repr(rawreldata) relinfo = [_extractChildRelInfo(cr) for cr in rawreldata] d['ChildRelationships'] = relinfo d['keyPrefix'] = str(r[_tPartnerNS.keyPrefix]) d['label'] = str(r[_tPartnerNS.label]) d['labelPlural'] = str(r[_tPartnerNS.labelPlural]) d['layoutable'] = _bool(r[_tPartnerNS.layoutable]) d['name'] = str(r[_tPartnerNS.name]) d['queryable'] = _bool(r[_tPartnerNS.queryable]) d['replicateable'] = _bool(r[_tPartnerNS.replicateable]) d['retrieveable'] = _bool(r[_tPartnerNS.retrieveable]) d['searchable'] = _bool(r[_tPartnerNS.searchable]) d['undeletable'] = _bool(r[_tPartnerNS.undeletable]) d['updateable'] = _bool(r[_tPartnerNS.updateable]) d['urlDetail'] = str(r[_tPartnerNS.urlDetail]) d['urlEdit'] = str(r[_tPartnerNS.urlEdit]) d['urlNew'] = str(r[_tPartnerNS.urlNew]) data.append(SObject(**d)) self.describeCache[str(r[_tPartnerNS.name])] = SObject(**d) return data