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


Python Session.execute方法代码示例

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


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

示例1: full_delete

# 需要导入模块: from pvscore.model.meta import Session [as 别名]
# 或者: from pvscore.model.meta.Session import execute [as 别名]
 def full_delete(comm_id):
     Session.execute("delete from crm_communication where comm_id = '%s'" % comm_id)
开发者ID:anonymoose,项目名称:pvscore,代码行数:4,代码来源:comm.py

示例2: clear

# 需要导入模块: from pvscore.model.meta import Session [as 别名]
# 或者: from pvscore.model.meta.Session import execute [as 别名]
 def clear(discount_id, product_id):
     Session.execute("delete from crm_discount_product where discount_id = '%s' and product_id = '%s'" % (discount_id, product_id))
开发者ID:anonymoose,项目名称:pvscore,代码行数:4,代码来源:discount.py

示例3: clear_all

# 需要导入模块: from pvscore.model.meta import Session [as 别名]
# 或者: from pvscore.model.meta.Session import execute [as 别名]
 def clear_all(fk_type, fk_id):
     #pylint: disable-msg=E1101
     Session.execute("delete from core_attribute_value where fk_type = '%s' and fk_id = '%s'" % (fk_type, fk_id))
开发者ID:anonymoose,项目名称:pvscore,代码行数:5,代码来源:attribute.py

示例4: full_delete

# 需要导入模块: from pvscore.model.meta import Session [as 别名]
# 或者: from pvscore.model.meta.Session import execute [as 别名]
    def full_delete(enterprise_id):
        from pvscore.model.crm.customer import Customer
        company_ids = db.get_list("select company_id from crm_company where enterprise_id = '%s'" % enterprise_id)
        campaign_ids = db.get_list("""select campaign_id from crm_campaign where
                                      company_id in (select company_id from crm_company where enterprise_id = '%s')""" % enterprise_id)

        customer_ids = db.get_list("""select customer_id from crm_customer where
                                      campaign_id in (select campaign_id from crm_campaign where
                                          company_id in (select company_id from crm_company where enterprise_id = '%s'))""" % enterprise_id)
        product_ids = db.get_list("""select product_id from crm_product where
                                     company_id in (select company_id from crm_company where enterprise_id = '%s')""" % enterprise_id)

        # KB: [2013-01-15]: pragma no cover on this because it is not possible to create customers or products on one campaign from another.
        for cid in customer_ids:  #pragma: no cover
            Customer.full_delete(cid[0])

        for pid in product_ids:   #pragma: no cover
            product_id = pid[0]
            Session.execute("delete from crm_product_return where product_id = '%s'" % product_id)
            Session.execute("delete from crm_product_category_join where product_id = '%s'" % product_id)
            Session.execute("delete from crm_product_child where parent_id = '%s'" % product_id)
            Session.execute("delete from crm_product_child where child_id = '%s'" % product_id)
            Session.execute("delete from crm_product_pricing where product_id = '%s'" % product_id)
            Session.execute("delete from crm_product_inventory_journal where product_id = '%s'" % product_id)
            Session.execute("delete from crm_purchase_order_item where product_id = '%s'" % product_id)
            Session.execute("delete from crm_order_item where product_id = '%s'" % product_id)
            Session.execute("delete from crm_product where product_id = '%s'" % product_id)

        for cid in campaign_ids:
            campaign_id = cid[0]
            Session.execute("delete from crm_product_pricing where campaign_id = '%s'" % campaign_id)

        for cid in company_ids:
            company_id = cid[0]
            Session.execute("delete from crm_product_category where company_id = '%s'" % company_id)
            Session.execute("delete from crm_report where company_id = '%s'" % company_id)
            Session.execute("""delete from cms_content where site_id in (select site_id from cms_site where company_id = '%s')""" % company_id)
            Session.execute("delete from cms_page where site_id in (select site_id from cms_site where company_id = '%s')" % company_id)
            Session.execute("delete from cms_site where company_id = '%s'" % company_id)
            Session.execute("update crm_company set default_campaign_id = null where company_id = '%s'" % company_id)
            Session.execute("delete from crm_campaign where company_id = '%s'" % company_id)
            Session.execute("delete from crm_purchase_order where company_id = '%s'" % company_id)

        Session.execute("delete from core_asset where enterprise_id = '%s'" % enterprise_id)            
        Session.execute("delete from crm_communication where enterprise_id = '%s'" % enterprise_id)
        Session.execute("delete from core_status where event_id in (select event_id from core_status_event where enterprise_id = '%s')" % enterprise_id)
        Session.execute("delete from core_status_event_reason where event_id in (select event_id from core_status_event where enterprise_id = '%s')" % enterprise_id)
        Session.execute("delete from core_status_event where enterprise_id = '%s'" % enterprise_id)
        Session.execute("delete from cms_template where enterprise_id = '%s'" % enterprise_id)
        Session.execute("delete from crm_company where enterprise_id = '%s'" % enterprise_id)
        #Session.execute('update core_user set enterprise_id = null where enterprise_id = '%s'" % enterprise_id)

        Session.execute("delete from core_status where username in (select user_id from core_user where enterprise_id = '%s')" % enterprise_id)
        Session.execute("delete from crm_customer where user_created in (select user_id from core_user where enterprise_id = '%s')" % enterprise_id)
        Session.execute("delete from crm_customer where user_assigned in (select user_id from core_user where enterprise_id = '%s')" % enterprise_id)
        Session.execute("delete from core_user where enterprise_id = '%s'" % enterprise_id)
        Session.execute("delete from crm_discount where enterprise_id = '%s'" % enterprise_id)
        Session.execute("delete from crm_vendor where enterprise_id = '%s'" % enterprise_id)
        Session.execute("delete from crm_enterprise where enterprise_id = '%s'" % enterprise_id)
开发者ID:anonymoose,项目名称:pvscore,代码行数:61,代码来源:company.py

示例5: full_delete

# 需要导入模块: from pvscore.model.meta import Session [as 别名]
# 或者: from pvscore.model.meta.Session import execute [as 别名]
 def full_delete(username):
     Session.execute("delete from core_user where username = '%s'" % username)
开发者ID:anonymoose,项目名称:pvscore,代码行数:4,代码来源:users.py

示例6: full_delete

# 需要导入模块: from pvscore.model.meta import Session [as 别名]
# 或者: from pvscore.model.meta.Session import execute [as 别名]
 def full_delete(event_id):
     Session.execute("delete from core_status_event where event_id = '%s'" % event_id)
开发者ID:anonymoose,项目名称:pvscore,代码行数:4,代码来源:statusevent.py

示例7: full_delete

# 需要导入模块: from pvscore.model.meta import Session [as 别名]
# 或者: from pvscore.model.meta.Session import execute [as 别名]
 def full_delete(listing_id):
     Session.execute("delete from pvs_listing where listing_id = '%s'" % listing_id)
开发者ID:anonymoose,项目名称:pvscore,代码行数:4,代码来源:listing.py

示例8: full_delete

# 需要导入模块: from pvscore.model.meta import Session [as 别名]
# 或者: from pvscore.model.meta.Session import execute [as 别名]
 def full_delete(appointment_id):
     Session.execute("delete from crm_appointment where appointment_id = '%s'" % appointment_id)
开发者ID:anonymoose,项目名称:pvscore,代码行数:4,代码来源:appointment.py

示例9: full_delete

# 需要导入模块: from pvscore.model.meta import Session [as 别名]
# 或者: from pvscore.model.meta.Session import execute [as 别名]
 def full_delete(phase_id):
     Session.execute("update crm_customer set phase_id = null where phase_id = '%s'" % str(phase_id))
     Session.execute("delete from crm_customer_phase where phase_id = '%s'" % str(phase_id))
开发者ID:anonymoose,项目名称:pvscore,代码行数:5,代码来源:customer.py


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