Hum, Sorry david, I think it was my fault, I forgot the update of the formencode, I used the Validator package, it is outdated but I didn't have a time to test it, I will do this test and conversion tomorrow...
> The FormEncode documentation and the FEComponent frequently state that we > can call validators.to_python, which apparently returns a requestDict that > we are in dire need of. After looking at all the source, we noticed that > validators.py doesn't have a to_python method but instead has a _to_python() > for each validator that inherits from FancyValidator. We tried using the > to_python() in the api.py->FancyValidator class but the arguments are > different. For example: > > > The to_validator in api.py, FancyValidator.py, etc are all defined as: > > def to_validator(value, state): > > The FEComponent.fecomponent.py tries to make a call to > validators.to_python(NestedVariables, rawFields), which doesn't exist. The > other problem is that NestedVariables is a class in variabledecode.py that > is derived from api.FancyValidator() so the to_python here is doing > something much different. I guess what I'm trying to say is that this was > doing some magic we are unable to reproduce. rawFields is a dictionary like this: {'name':'Michel', 'document.id':'415', 'document.date':'2005-02-26', 'action.ok':'Ok'} Validating (converting) it with NestedVariables converts it to: {'name':'Michel', 'document':{'id':'415', 'date':'2005-02-26'}, 'action':{'ok':'Ok'}} Undestand? It comes from the variabledecode module, I don't know the problem know, but maybe is the validator package I using is outdated... > Do you know if we can find an older version of FormEncode or better yet, > point us in a direction where we can see what the above to_python is really > doing? Take a look at the FancyValidator code: def to_python(self, value, state=None): return self.attempt_convert(value, state, self.validate_other, self._to_python, self.validate_python) If you take a look at the attempt_convert code you will understand the usage, I'm not very clear about this but I think may use to_python on your own validators or use the combination of validate_other, _to_python and validate_python... Anyway, any validator extended from FancyValidator has a to_python method. I will upgrade the FEComponent to the last svn FormEncode tomorrow, sorry any mistake :) I didn't have the time to update formencode, I use validator package on a working project... regards, -- Michel Thadeu Sabchuk Curitiba - Brasil ------------------------------------------------------- SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate online with coworkers and clients while avoiding the high cost of travel and communications. There is no equipment to buy and you can meet as often as you want. Try it free.http://ads.osdn.com/?ad_idt02&alloc_id135&op=click _______________________________________________ Webware-discuss mailing list Webware-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/webware-discuss