On validation errors of *fields* in a FFK form the defaults are kept, when
they are displayed again with an error message.
On contrary the defaults of all the fields are not kept, when the *form*
validation fails.
I set the defaults upon the call to renderableform().
The form validation code is:
class ValidateForm(FormValidator):
def validate(self, dict):
assert type(dict) == type({})
if not dict['timeBeg'] < dict['timeEnd']:
return 'End time has to be greater than start time!'
if dict['filterProjects']:
# Button 'filterProjects' was pressed.
# So we do NOT validate the form for now
assert dict['enter'] == 0, 'More than one buttons received!'
return None
assert dict['enter'] == 1, 'Unknown button was pressed!'
if self.newTaskIntersectsExisting(dict):
errorstring = 'This task intersects an already existing, check
your time values!'
return {'timeBeg': errorstring, 'timeEnd': errorstring}
return None
What do I miss?
Thanks in advance and best regards
Franz
--------------------------------------------------------
DATEC Datentechnik GmbH
Software Development
Retrieval Computing
A-6890 LUSTENAU, Schmiedgasse 7
Tel +43 5577 630 04-0
Fax +43 5577 630 04-40
Mobile
+43 664 214 57 43
E-Mail
[EMAIL PROTECTED]
WWW www.datec.at (in Partnerschaft mit Amazon.de)
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss