当前位置: 首页>>代码示例>>Python>>正文


Python Salesforce.describe方法代码示例

本文整理汇总了Python中simple_salesforce.Salesforce.describe方法的典型用法代码示例。如果您正苦于以下问题:Python Salesforce.describe方法的具体用法?Python Salesforce.describe怎么用?Python Salesforce.describe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在simple_salesforce.Salesforce的用法示例。


在下文中一共展示了Salesforce.describe方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: refresh

# 需要导入模块: from simple_salesforce import Salesforce [as 别名]
# 或者: from simple_salesforce.Salesforce import describe [as 别名]
    def refresh(self, force=False):
        """
        Refreshes this token if the session has expired.

        :param force: Refresh this token even if the session hasn't expired
        """
        if force:
            auth.refresh_token(self)
            return Salesforce(instance_url=self.instance_url, session_id=self.access_token, sandbox=self.is_sandbox)

        try:
            connection = Salesforce(instance_url=self.instance_url, session_id=self.access_token, sandbox=self.is_sandbox)
            connection.describe()
        except (SalesforceExpiredSession, SalesforceGeneralError):
            auth.refresh_token(self)
            return Salesforce(instance_url=self.instance_url, session_id=self.access_token, sandbox=self.is_sandbox)
        else:
            return connection
开发者ID:john2world,项目名称:Ring1leads,代码行数:20,代码来源:models.py

示例2: returnsObject

# 需要导入模块: from simple_salesforce import Salesforce [as 别名]
# 或者: from simple_salesforce.Salesforce import describe [as 别名]
 def returnsObject(self):
     sf = Salesforce(instance_url=self.instance_url, session_id=self.session_id)
     object_list = []
     for x in sf.describe()['sobjects']:
         l1 = {}
         l1['name']=x['name']
         l1['custom']=x['custom']
         l1['label']=x['label']
         object_list.append(l1)
     return object_list
开发者ID:mudits1990,项目名称:Pyramidapp,代码行数:12,代码来源:sfdc.py

示例3: handler

# 需要导入模块: from simple_salesforce import Salesforce [as 别名]
# 或者: from simple_salesforce.Salesforce import describe [as 别名]
def handler(event, context):
    log.debug("Received event {}".format(json.dumps(event)))
    sf = Salesforce(instance_url=event["instance_url"], session_id=event["session_id"])
    objs = sf.describe()["sobjects"]
    objects = map(describe(sf),objs)   
    client = boto3.client("dynamodb") 
    client.batch_write_item(RequestItems={'sobs-metadata-dev':map((lambda obj: {'PutRequest':{'Item':obj}}),objects)})

        
    return {}
开发者ID:cdcarter,项目名称:sobs,代码行数:12,代码来源:handler.py

示例4: Salesforce

# 需要导入模块: from simple_salesforce import Salesforce [as 别名]
# 或者: from simple_salesforce.Salesforce import describe [as 别名]
	sf = Salesforce(username=salesforceusername, password=salesforcepassword, security_token=salesforcesecuritytoken)


# establish connection to local db
print ("Testing local MySQL DB connection")
try:
  cnx = mysql.connector.connect(**config)
  cursor = cnx.cursor(buffered=True)
  print ("Connection successful")
except mysql.connector.Error as err:
  print("MySQL db settings error: {}".format(err))

# silent test to verify connection to salesforce complete
print ("Testing Salesforce Instance connection")
try:
	sf.describe()
	print ("Connection successful")
except SalesforceError as err:
	print("Salesforce connection error: {}".format(err))

# check if first run of script
print ("Checking to See if Default SF Object Table is available")
sfobjectcheck = "SHOW TABLES LIKE 'sfobject_sfobject'"
cursor.execute(sfobjectcheck)
result1 = cursor.fetchone()
if result1:
    sfobjcheck = 1;
else:
	sobjectablecreate = ("CREATE TABLE sfobject_sfobject (data_id int(11) NOT NULL AUTO_INCREMENT Primary Key, obj_name TEXT,obj_keyPrefix TEXT,obj_label TEXT,obj_createable TEXT,obj_custom TEXT,obj_customSetting TEXT,created_at DATETIME DEFAULT NULL,modified_at DATETIME DEFAULT NULL)")
	cursor.execute(sobjectablecreate)
	sfobjcheck = 0;
开发者ID:danielbprobert,项目名称:python-sfbackup,代码行数:33,代码来源:sfbackup.py

示例5: returnsObject

# 需要导入模块: from simple_salesforce import Salesforce [as 别名]
# 或者: from simple_salesforce.Salesforce import describe [as 别名]
 def returnsObject(self):
     sf = Salesforce(username=self.username, password=self.password, security_token=self.security_token)
     l1 = [[x['name'],x['custom'],x['label']] for x in sf.describe()['sobjects']]
     return l1
开发者ID:mudits1990,项目名称:sfdcdata-fetch,代码行数:6,代码来源:sfdc.py

示例6: Salesforce

# 需要导入模块: from simple_salesforce import Salesforce [as 别名]
# 或者: from simple_salesforce.Salesforce import describe [as 别名]
from simple_salesforce import Salesforce
from pandas import DataFrame
from collections import defaultdict

## create database engine and open a connection
engine = databaseconfig.DB_ENGINE
conn = engine.connect()

## create a salesforce session
sf = Salesforce(username=SF_UID,
                password=SF_PWD,
                security_token=SF_TOKEN,
                organizationId='00Di0000000hSDR')

ktc_tables = sf.describe()
ktc_tables = ktc_tables[u'sobjects']
table_names = []

for i in ktc_tables:
    table_names.append(i[u'name'])

#the ones we want
desired_tables = ['Account', 'Contact', 'College_Persistence__c', 'Contact', 'Contact_Note__c', 'Enrollment__c']

all_tables = defaultdict()
for i in desired_tables:
    print 'Retrieving fields for table %s from Salesforce.' % i
    #this gets us the attributes of the table
    this_table = sf.__getattr__(i).describe()
开发者ID:KIPPLADataTeam,项目名称:silo,代码行数:31,代码来源:sf_get_and_load.py


注:本文中的simple_salesforce.Salesforce.describe方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。