Closed sergei-maertens closed 8 years ago
Can you please log each issue separately?
I'm not really sure how, I'm actually describing a single issue here. I do mention another one, but that PR already got merged so that's fine.
I'll edit the first line to make it clear that it's a single issue.
Tests + fixes in https://github.com/funkybob/django-sniplates/pull/38
So, first bit of testing this feature branch, and I ran into the following issue:
A lot of the provided templates will have to change
value
toraw_value
, including your test templates I think. Right now, theraw_value
None
will be output inTextInput
as<input type="text" value="None">
. Or, thevalue
property should maybe catch the valuesNone
, 'False,
True`.My personal preference would be to just use raw_value in the template, but that can lead to inconsistencies. For scalar values it makes sense, for fields with choices not so much, since the
choices
property returns values that have beenforce_text
'ed, you have to do the comparisons against theforce_text
'ed raw_value, which isvalue
in the template. So then you will be usingraw_value
andvalue
in the template, for seemingly the same check - i.e.: is this choice the current/selected value?