diefenbach / django-lfs

An online-shop based on Django
http://www.getlfs.com
BSD 3-Clause "New" or "Revised" License
622 stars 222 forks source link

It's impossible to check off "Active packing" and "Active base price" checkboxes. #7

Closed Zagrebelin closed 12 years ago

Zagrebelin commented 12 years ago

Product model use PositiveSmallIntegerField for active_packing_unit and active_base_price fields. Value of that fields can be either 0, or 1. CheckBoxInput widget use this code to decide when checkbox must be checked: lambda v: not (v is False or v is None or v == '') django/forms/widgets.py#496 and #503

so, both values of the fields check that chekboxes.

Best solution will be change active_bla_bla to BooleanField, but this patch is fine too.

diefenbach commented 12 years ago

Merged.

Tricky one.

Thanks! Kai