class SproxCheckBox(CheckBox):
def prepare(self):
super(SproxCheckBox, self).prepare()
self.attrs['value'] = self.value
if self.attrs['value'] == 'False':
self.attrs.pop("checked", None) #checkbox automatically checked if checked in self.attrs
--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email to turbogears+...@googlegroups.com.
To post to this group, send email to turbo...@googlegroups.com.
Visit this group at http://groups.google.com/group/turbogears?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
class SproxCheckBox(CheckBox):
def prepare(self):
super(SproxCheckBox, self).prepare()
self.attrs['value'] = 'True'
if self.value == 'False':
self.attrs.pop("checked", None)
--
You received this message because you are subscribed to the Google Groups "sprox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sprox+un...@googlegroups.com.
To post to this group, send email to sp...@googlegroups.com.
Visit this group at http://groups.google.com/group/sprox?hl=en.
I revisited this issue with the sprox update and am still having checkboxes checked when value is False using ming.
The reason appears to be that on line 441 in tw2.forms.fields, d.attrs['checked'] = checked or None still is passed with None when false, just having checked= in the html causes the checkbox to be checked. In other-words, tw2.forms passes checked= no matter what the value is and causes the checkbox to be checked.
I still have to use the following in my code to make the checkboxes function correctly by removing the 'checked' attrs when false:class CheckBox(SproxCheckBox):self.attrs['value'] = 'True'
def prepare(self):
super(SproxCheckBox, self).prepare()
if self.value == 'False':
self.attrs.pop("checked", None)
class forms(CrudRestControllerConfig):
class edit_form_type(EditableForm):
__entity__ = Forms
boolField = CheckBoxshortened model is:
class Forms(MappedClass):
"""model for form info"""
class __mongometa__:
session = DBSession
name = 'forms'
_id = FieldProperty(s.ObjectId)
boolField = FieldProperty(bool)
Visit this group at http://groups.google.com/group/sprox.
For more options, visit https://groups.google.com/d/optout.