Hi,

i validate a form using FormEncode and went through the examples.
Generally it works fine now, but there on thing i can't get solved:
In my application, the admin creates user accounts, and while he does,
he enters a password and confirms ist. I found out that this works by
doing this:

chained_validators = [validators.FieldsMatch('password',
'password_confirm')]

Alright, but what if the user is not new, and the admin just wants to
edit the user data? In this case, he should not be forced to enter the
password (twice) but leave the fields blank. And ideas how to get
there?

The second problem is my custom filter "UniqueEmail" - the filter
itself works well, but is also is triggered when a user account is
updated. Of course, the filter throws an "this mail address already
exists"-error. I would like to implement a workaround by checking the
user id first and then dependent on that skip the filter, but i can't
find a way to access the entity in the validator.

I think this problem ist a common one, so does there already exist a
solution, or generally, a best practice for forms like this?

thanks a lot.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to