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


Python E.additionalData方法代码示例

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


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

示例1: create_customer

# 需要导入模块: from openprovider.modules import E [as 别名]
# 或者: from openprovider.modules.E import additionalData [as 别名]
    def create_customer(self, name, gender, address, phone, email, vat=None, fax=None,
                        company_name=None, additional_data={}):
        """Create a customer"""

        response = self.request(E.createCustomerRequest(
            E.companyName(company_name),
            E.vat(vat),
            E.name(
                E.initials(name.initials),
                E.firstName(name.first_name),
                E.prefix(name.prefix or ''),
                E.lastName(name.last_name),
            ),
            E.gender(gender),
            _get_phone_xml('phone', phone),
            _get_phone_xml('fax', fax),
            E.address(
                E.street(address.street),
                E.number(address.number),
                E.suffix(address.suffix or ''),
                E.zipcode(address.zipcode),
                E.city(address.city),
                E.state(address.state or ''),
                E.country(address.country),
            ),
            E.email(email),
            E.additionalData(*[E(key, value) for key, value in additional_data.items()]),
        ))

        return str(response.data.handle)
开发者ID:aschenkels-ictstudio,项目名称:openprovider.py,代码行数:32,代码来源:customer.py

示例2: _additional_data

# 需要导入模块: from openprovider.modules import E [as 别名]
# 或者: from openprovider.modules.E import additionalData [as 别名]
def _additional_data(data):
    if data is None:
        return None

    element = E.additionalData()
    for key, value in data.items():
        if key == 'birth_date':
            try:
                value = value.strftime('%Y-%m-%d')
            except AttributeError:
                pass
        element.append(E(snake_to_camel(key), value))
    return element
开发者ID:AntagonistHQ,项目名称:openprovider.py,代码行数:15,代码来源:customer.py

示例3: modify_customer

# 需要导入模块: from openprovider.modules import E [as 别名]
# 或者: from openprovider.modules.E import additionalData [as 别名]
    def modify_customer(self, handle, address, phone, email=None, vat=None, fax=None,
                        company_name=None, additional_data={}):
        """Modify a customer."""

        self.request(E.modifyCustomerRequest(
            E.handle(handle),
            E.vat(vat or ''),
            _get_phone_xml('phone', phone),
            _get_phone_xml('fax', fax),
            E.address(
                E.street(address.street),
                E.number(address.number),
                E.suffix(address.suffix or ''),
                E.zipcode(address.zipcode),
                E.city(address.city),
                E.state(address.state or ''),
                E.country(address.country),
            ),
            E.email(email or ''),
            E.additionalData(*[E(key, value) for key, value in additional_data.items()]),
        ))

        return True
开发者ID:aschenkels-ictstudio,项目名称:openprovider.py,代码行数:25,代码来源:customer.py

示例4: _additional_data

# 需要导入模块: from openprovider.modules import E [as 别名]
# 或者: from openprovider.modules.E import additionalData [as 别名]
def _additional_data(data):
    if not data:
        return None

    items = [E(key, value) for key, value in data.items()]
    return E.additionalData(*items)
开发者ID:AntagonistHQ,项目名称:openprovider.py,代码行数:8,代码来源:domain.py


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