Hi folks,
I try to validate widgets forms with schemas, in order to clean up my
code.
I have got an 'edit' method in my controller which get the form to edit
and populate it with the appropriate data. This works well.
The forms have a 'save' action. The 'save' method is decorated by
@validate(form=a_function_to_retrieve_the_current_form) and
@error_handler(edit).
If the validators are defined inside the widget classes, everything is
fine : on error, the form is displayed again with errors and all other
values are here.
But when I try to set decorators in a schema, multiple and single select
fields are not populated again with the values the user just gave. As
if they were not converted to integers as they should.
The way I set up validators is here :
http://paste.turbogears.org/paste/5584
I tried to isolate the problem coding a small app to try to reproduce
the problem and find out if I missed something with validation schemas,
but nope, I am able to validate forms as expected in this test context.
So, there must be something wrong in my code and it is related to the
validation process.
Does anybody has any clue on how to debug this in a clever way,
provided that when turbogears build the validation schema from form
fields validators, it works, but it fails when I provide my own
schemas ? 
I can send my whole code if it helps.

tg version : 1.0-1
formencode version : 0.6-1

Thanks in advance,
Luc
-- 
Luc Milland
[EMAIL PROTECTED]
06.62.36.85.80
clé pgp  :  7333 7952

PGP est un mécanisme de signature/cryptage. Le fichier "signature.asc"
éventuellement associé à ce mail n'est pas une pièce jointe ordinaire,
inutile de chercher à l'ouvrir.

Plus d'information sur PGP : http://fr.wikipedia.org/wiki/OpenPGP

Pour utiliser PGP : http://fr.wikipedia.org/wiki/GnuPG

Attachment: signature.asc
Description: PGP signature

Reply via email to