Пример #1
0
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()]
Пример #2
0
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()]
Пример #3
0
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]
Пример #4
0
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]
Пример #5
0
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(),
    )
Пример #6
0
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(),
    )