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


Python Pool.default_get方法代码示例

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


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

示例1: default_addresses

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import default_get [as 别名]
 def default_addresses():
     if Transaction().user == 0:
         return []
     Address = Pool().get('party.address')
     fields_names = list(x for x in Address._fields.keys()
         if x not in ('id', 'create_uid', 'create_date',
             'write_uid', 'write_date'))
     return [Address.default_get(fields_names)]
开发者ID:aleibrecht,项目名称:tryton-modules-ar,代码行数:10,代码来源:party.py

示例2: get_defaults

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import default_get [as 别名]
 def get_defaults(self, wizard, state_name, fields):
     '''
     Returns defaults values for the fields
     '''
     Model_ = Pool().get(self.model_name)
     defaults = Model_.default_get(fields)
     default = getattr(wizard, 'default_%s' % state_name, None)
     if default:
         defaults.update(default(fields))
     return defaults
开发者ID:Sisouvan,项目名称:ogh,代码行数:12,代码来源:wizard.py

示例3: _get_grouped_invoice_domain

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import default_get [as 别名]
 def _get_grouped_invoice_domain(self, invoice):
     "Returns a domain that will find invoices that should be grouped"
     Invoice = Pool().get('account.invoice')
     invoice_domain = [
         ('lines.origin', 'like', 'sale.line,%'),
         ]
     defaults = Invoice.default_get(self._invoice_grouping_fields,
         with_rec_name=False)
     for field in self._invoice_grouping_fields:
         invoice_domain.append(
             (field, '=', getattr(invoice, field, defaults.get(field)))
             )
     return invoice_domain
开发者ID:kret0s,项目名称:gnuhealth-live,代码行数:15,代码来源:sale.py

示例4: transition_selected

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import default_get [as 别名]
    def transition_selected(self):
        statename = self._make_component_state_view(self.selector.component_type)
        state = self.states[statename]
        ComponentModel = Pool().get(state.model_name)
        encounter_id = self._component_data["active_id"]
        component_data = {"encounter": encounter_id}
        view = state.get_view()
        field_names = view["fields"].keys()
        if "id" in field_names:
            del field_names[field_names.index["id"]]
        component_data.update(ComponentModel.default_get(field_names))

        real_component = ComponentModel(**component_data)
        setattr(self, statename, real_component)
        self._component_data.update(obj=real_component)
        return statename
开发者ID:nnaidu,项目名称:health_encounter,代码行数:18,代码来源:wizard.py


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