Exemplo n.º 1
0
def QuantityUnitVocabulary(context):
    # vocab is used for buyable items
    try:
        settings = get_shop_article_settings()
    except KeyError:
        # happens GS profile application if registry entries not present yet
        return AvailableQuantityUnitVocabulary(context)
    if not settings:
        return
    terms = []
    for quantity_unit in settings.quantity_units:
        title = AVAILABLE_QUANTITY_UNITS.get(quantity_unit, quantity_unit)
        terms.append(SimpleTerm(value=quantity_unit, title=title))
    return SimpleVocabulary(terms)
Exemplo n.º 2
0
def QuantityUnitVocabulary(context):
    # vocab is used for buyable items
    try:
        settings = get_shop_article_settings()
    except KeyError:
        # happens GS profile application if registry entries not present yet
        return AvailableQuantityUnitVocabulary(context)
    if not settings:
        return
    terms = []
    for quantity_unit in settings.quantity_units:
        title = AVAILABLE_QUANTITY_UNITS.get(quantity_unit, quantity_unit)
        terms.append(SimpleTerm(value=quantity_unit, title=title))
    return SimpleVocabulary(terms)
Exemplo n.º 3
0
def default_item_comment_required(context):
    return get_shop_article_settings().default_item_comment_required
Exemplo n.º 4
0
def default_item_cart_count_limit(context):
    return get_shop_article_settings().default_item_cart_count_limit
Exemplo n.º 5
0
def default_item_net(context):
    return get_shop_article_settings().default_item_net
Exemplo n.º 6
0
def item_comment_enabled(context):
    return get_shop_article_settings().default_item_comment_enabled
Exemplo n.º 7
0
def default_item_quantity_unit_float(context):
    return lambda: get_shop_article_settings().default_item_quantity_unit_float
Exemplo n.º 8
0
def default_item_stock_warning_threshold(context):
    return get_shop_article_settings().default_item_stock_warning_threshold
Exemplo n.º 9
0
 def default_item_stock_warning_threshold_func():
     settings = get_shop_article_settings()
     return settings.default_item_stock_warning_threshold
Exemplo n.º 10
0
def default_item_quantity_unit_float(context):
    return get_shop_article_settings().default_item_quantity_unit_float
Exemplo n.º 11
0
def default_item_comment_required(context):
    return lambda: get_shop_article_settings().default_item_comment_required
Exemplo n.º 12
0
def default_item_cart_count_limit(context):
    return lambda: get_shop_article_settings().default_item_cart_count_limit
Exemplo n.º 13
0
def item_comment_enabled(context):
    return lambda: get_shop_article_settings().default_item_comment_enabled
Exemplo n.º 14
0
def default_item_net(context):
    return lambda: get_shop_article_settings().default_item_net
Exemplo n.º 15
0
def default_item_cart_count_limit(context):
    default = get_shop_article_settings().default_item_cart_count_limit
    if default is not None:
        return Decimal(default)
    return default
Exemplo n.º 16
0
def default_item_quantity_unit(context):
    return get_shop_article_settings().default_item_quantity_unit
Exemplo n.º 17
0
 def default_item_stock_warning_threshold_func():
     settings = get_shop_article_settings()
     return settings.default_item_stock_warning_threshold
Exemplo n.º 18
0
def default_item_quantity_unit(context):
    return lambda: get_shop_article_settings().default_item_quantity_unit
Exemplo n.º 19
0
def default_item_stock_warning_threshold(context):
    return get_shop_article_settings().default_item_stock_warning_threshold