本文整理匯總了Python中_beatbox.Client.describeSObjects方法的典型用法代碼示例。如果您正苦於以下問題:Python Client.describeSObjects方法的具體用法?Python Client.describeSObjects怎麽用?Python Client.describeSObjects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類_beatbox.Client
的用法示例。
在下文中一共展示了Client.describeSObjects方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: describeSObjects
# 需要導入模塊: from _beatbox import Client [as 別名]
# 或者: from _beatbox.Client import describeSObjects [as 別名]
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
示例2: describeSObjects
# 需要導入模塊: from _beatbox import Client [as 別名]
# 或者: from _beatbox.Client import describeSObjects [as 別名]
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