Revision [913]

Last edited on 2008-05-31 17:15:03 by KlenwellAdmin
Additions:
# extending charField with own class that overrides clean method (used for validation) so that
# it requires two items be picked from list
class PickTwoField(forms.CharField):
def clean(self, value):
if len(value) != 2:
raise forms.ValidationError('Please select two (2) choices below')
return value
picktwo = PickTwoField(widget=forms.CheckboxSelectMultiple(choices=CHOICES_PICKTWO))
Deletions:
picktwo = forms.CharField(widget=forms.CheckboxSelectMultiple(choices=CHOICES_PICKTWO))


Revision [911]

Edited on 2008-05-31 10:36:55 by KlenwellAdmin
Additions:
('fast',"fast"),
('cheap',"cheap"),
('works',"works")
Deletions:
('FAST',"fast"),
('CHEAP',"cheap"),
('WORKS',"works")


Revision [910]

Edited on 2008-05-31 10:36:30 by KlenwellAdmin
Additions:
===Widget Overriding===
Deletions:
===Radio / Checkbox Lists===


Revision [909]

Edited on 2008-05-31 10:35:35 by KlenwellAdmin
Additions:
return to [[CategoryGoogleAppEngine Google App Engine home]]
# set choice list: notice that we require a tuple of tuples containing both value and label items
# the google examples gave me the impression you could use a 1-D sequence
# NOTE: we have to explicitly pass our choice list as a key argument to our widget constructor
model = DemoModel
Deletions:
# set choice list: notice that we require a tuple of tuples containg both value and label items
# the google examples gave me the impress you could use a 1-D sequence
# NOTE: we have to explicit pass our choice list as a key argument to our widget constructor
model = DemoMode


Revision [908]

The oldest known version of this page was created on 2008-05-31 10:26:01 by KlenwellAdmin
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki