@@ -44,13 +44,16 @@ class _QuantityBoxProductsForm(_ProductsForm):
''' Products entry form that allows users to enter quantities
of desired products. '''
@classmethod
def set_fields(cls, category, products):
for product in products:
help_text = "$%d -- %s" % (product.price, product.description)
if product.description:
help_text = "$%d each -- %s" % (product.price, product.description)
else:
help_text = "$%d each" % product.price
field = forms.IntegerField(
label=product.name,
help_text=help_text,
)
cls.base_fields[cls.field_name(product)] = field