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)
示例#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)
示例#3
0
def default_item_comment_required(context):
    return get_shop_article_settings().default_item_comment_required
示例#4
0
def default_item_cart_count_limit(context):
    return get_shop_article_settings().default_item_cart_count_limit
示例#5
0
def default_item_net(context):
    return get_shop_article_settings().default_item_net
示例#6
0
def item_comment_enabled(context):
    return get_shop_article_settings().default_item_comment_enabled
示例#7
0
def default_item_quantity_unit_float(context):
    return lambda: get_shop_article_settings().default_item_quantity_unit_float
示例#8
0
def default_item_stock_warning_threshold(context):
    return get_shop_article_settings().default_item_stock_warning_threshold
示例#9
0
 def default_item_stock_warning_threshold_func():
     settings = get_shop_article_settings()
     return settings.default_item_stock_warning_threshold
示例#10
0
def default_item_quantity_unit_float(context):
    return get_shop_article_settings().default_item_quantity_unit_float
示例#11
0
def default_item_comment_required(context):
    return lambda: get_shop_article_settings().default_item_comment_required
示例#12
0
def default_item_cart_count_limit(context):
    return lambda: get_shop_article_settings().default_item_cart_count_limit
示例#13
0
def item_comment_enabled(context):
    return lambda: get_shop_article_settings().default_item_comment_enabled
示例#14
0
def default_item_net(context):
    return lambda: get_shop_article_settings().default_item_net
示例#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
示例#16
0
def default_item_quantity_unit(context):
    return get_shop_article_settings().default_item_quantity_unit
示例#17
0
 def default_item_stock_warning_threshold_func():
     settings = get_shop_article_settings()
     return settings.default_item_stock_warning_threshold
示例#18
0
def default_item_quantity_unit(context):
    return lambda: get_shop_article_settings().default_item_quantity_unit
示例#19
0
def default_item_stock_warning_threshold(context):
    return get_shop_article_settings().default_item_stock_warning_threshold