Commit 0166c584 authored by Jérome Perrin's avatar Jérome Perrin

use if value instead of if value == 1

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31751 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c7b31728
...@@ -63,7 +63,7 @@ add_predicate = 1\n ...@@ -63,7 +63,7 @@ add_predicate = 1\n
\n \n
\n \n
# Get base category list\n # Get base category list\n
if option_variation==1:\n if option_variation:\n
# Get option base category list\n # Get option base category list\n
add_predicate = 0\n add_predicate = 0\n
no_option_base_category_list = context.getVariationRangeBaseCategoryList(\n no_option_base_category_list = context.getVariationRangeBaseCategoryList(\n
...@@ -96,7 +96,7 @@ else:\n ...@@ -96,7 +96,7 @@ else:\n
\n \n
# Generate cell range\n # Generate cell range\n
for base_category_list in base_category_list_list:\n for base_category_list in base_category_list_list:\n
if matrixbox==1:\n if matrixbox:\n
# XXX matrixbox is right_display (not as listfield) \n # XXX matrixbox is right_display (not as listfield) \n
# => invert display and value in item\n # => invert display and value in item\n
cell_range.append(map(lambda x: (x[1], x[0]),\n cell_range.append(map(lambda x: (x[1], x[0]),\n
...@@ -110,11 +110,11 @@ for base_category_list in base_category_list_list:\n ...@@ -110,11 +110,11 @@ for base_category_list in base_category_list_list:\n
base_category_list=base_category_list,\n base_category_list=base_category_list,\n
sort_id=\'id\'))\n sort_id=\'id\'))\n
# If no option, don\'t display quantity range\n # If no option, don\'t display quantity range\n
if option_variation == 1:\n if option_variation:\n
if cell_range != []:\n if cell_range != []:\n
add_predicate = 1\n add_predicate = 1\n
# Do we need to add predicate ?\n # Do we need to add predicate ?\n
if add_predicate == 1:\n if add_predicate:\n
# Get quantity step\n # Get quantity step\n
# XXX Dirty, use the same quantity range for option/no option matrix\n # XXX Dirty, use the same quantity range for option/no option matrix\n
if base_id == \'path\':\n if base_id == \'path\':\n
...@@ -126,7 +126,8 @@ if add_predicate == 1:\n ...@@ -126,7 +126,8 @@ if add_predicate == 1:\n
if price_parameter.startswith(option_base_id_begin_with):\n if price_parameter.startswith(option_base_id_begin_with):\n
price_parameter = price_parameter[len(option_base_id_begin_with):]\n price_parameter = price_parameter[len(option_base_id_begin_with):]\n
predicate_list = context.getQuantityPredicateValueList(price_parameter)\n predicate_list = context.getQuantityPredicateValueList(price_parameter)\n
if matrixbox == 1:\n \n
if matrixbox:\n
# pred_ids = [(x.getRelativeUrl(), x.getTitle()) for x in predicate_list]\n # pred_ids = [(x.getRelativeUrl(), x.getTitle()) for x in predicate_list]\n
# Translate the matrixbox ranges\n # Translate the matrixbox ranges\n
pred_ids = []\n pred_ids = []\n
......
417 419
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment