def get_product_choices(): """ Return data structure for product code select widget options """ return [(p.id, u"{0} ({1} - {2})".format( p.name, p.compte_cg, p.tva.name),) for p in Product.query()]
def get_product_choices(): """ Return data structure for product code select widget options """ return [( p.id, u"{0} ({1} - {2})".format(p.name, p.compte_cg, p.tva.name), ) for p in Product.query()]
def json_products(request): """ Return the product objects available for this form :param obj request: The current request object :returns: List of Product objects in their json repr """ query = Product.query() return [item.__json__(request) for item in query]
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(), products=Product.query().all(), training_type=TrainingTypeOptions.query().all(), )