本文整理汇总了Python中autonomie.models.tva.Tva.query方法的典型用法代码示例。如果您正苦于以下问题:Python Tva.query方法的具体用法?Python Tva.query怎么用?Python Tva.query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autonomie.models.tva.Tva
的用法示例。
在下文中一共展示了Tva.query方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __call__
# 需要导入模块: from autonomie.models.tva import Tva [as 别名]
# 或者: from autonomie.models.tva.Tva import query [as 别名]
def __call__(self):
for tva in Tva.query(include_inactive=True):
tva.default = False
self.request.dbsession.merge(tva)
self.context.default = True
self.request.dbsession.merge(tva)
return HTTPFound(TVA_URL)
示例2: task_options_json
# 需要导入模块: from autonomie.models.tva import Tva [as 别名]
# 或者: from autonomie.models.tva.Tva import query [as 别名]
def task_options_json(request):
"""
Returns the task form options as a dict
"""
options = dict()
options['tvas'] = dict((tva.value, tva.__json__(request)) \
for tva in Tva.query().all())
return options
示例3: json_tvas
# 需要导入模块: from autonomie.models.tva import Tva [as 别名]
# 或者: from autonomie.models.tva.Tva import query [as 别名]
def json_tvas(request):
"""
Return the tva objects available for this form
:param obj request: The current request object
:returns: List of Tva objects in their json repr
"""
query = Tva.query()
return [item.__json__(request) for item in query]
示例4: company_products_options_ajax_view
# 需要导入模块: from autonomie.models.tva import Tva [as 别名]
# 或者: from autonomie.models.tva.Tva import query [as 别名]
def company_products_options_ajax_view(context, request):
"""
The view for company products options load
:param obj context: The context : The company object
:param obj request: the Pyramid's request object
"""
return dict(
tvas=Tva.query().all(),
unities=WorkUnit.query().all()
)
示例5: before
# 需要导入模块: from autonomie.models.tva import Tva [as 别名]
# 或者: from autonomie.models.tva.Tva import query [as 别名]
def before(self, form):
"""
Add appstruct to the current form object
"""
appstruct = []
for tva in Tva.query().all():
struct = tva.appstruct()
struct['products'] = [product.appstruct()
for product in tva.products]
appstruct.append(struct)
form.set_appstruct({'tvas':appstruct})
populate_actionmenu(self.request)
log.debug("AdminTva struct: %s", appstruct)
示例6: get_tva_objects
# 需要导入模块: from autonomie.models.tva import Tva [as 别名]
# 或者: from autonomie.models.tva.Tva import query [as 别名]
def get_tva_objects(cls, task_obj):
"""
:param task_obj: The Task object we want to collect tvas for
:returns: tva stored by amount
:rtype: dict
"""
tva_values = set()
for group in task_obj.line_groups:
for line in group.lines:
tva_values.add(line.tva)
tvas = Tva.query().filter(
Tva.value.in_(list(tva_values))
).all()
return dict([(tva.value, tva) for tva in tvas])
示例7: get_tva
# 需要导入模块: from autonomie.models.tva import Tva [as 别名]
# 或者: from autonomie.models.tva.Tva import query [as 别名]
def get_tva(self):
return Tva.query(include_inactive=True).filter(Tva.value == self.tva)
示例8: get_tva_choices
# 需要导入模块: from autonomie.models.tva import Tva [as 别名]
# 或者: from autonomie.models.tva.Tva import query [as 别名]
def get_tva_choices():
"""
Return data structure for tva select widget options
"""
return [(unicode(tva.value), tva.name)for tva in Tva.query()]
示例9: tvas
# 需要导入模块: from autonomie.models.tva import Tva [as 别名]
# 或者: from autonomie.models.tva.Tva import query [as 别名]
def tvas(self):
return Tva.query().all()
示例10: load_items
# 需要导入模块: from autonomie.models.tva import Tva [as 别名]
# 或者: from autonomie.models.tva.Tva import query [as 别名]
def load_items(self):
return Tva.query(include_inactive=True).all()