HiMike,
Firstly thankyou for helping me.
Its thowing me trying to understand "post_validators". What is
post_validators?
Within my code I have:
@restrict('POST')
@validate(schema=ClientNewForm(),form='registration')
So when the form is posted the verification takes place by calling
ClientNewForm()
class ClientNewForm(formencode.Schema):
allow_extra_fields = True
filter_extra_fields = True
firstname = formencode.validators.String(not_empty=True)
lastname = formencode.validators.String(not_empty=True)
cardType = formencode.validators.String(not_empty=True)
cardNumber = formencode.validators.String(not_empty=True)
ccType=cardType
ccNumber=cardNumber
cc = formencode.validators.CreditCardValidator()
If this isnt too much to ask, could you provide a simple example or
point me to a resource that
explains this to me.
Thanks,
Garyc
On Jan 1, 12:29 pm, Mike Orr <[email protected]> wrote:
> On Fri, Jan 1, 2010 at 8:55 AM, gazza <[email protected]> wrote:
> > Hello,
>
> > I'm having a wee' issue on this problem of introducing the credit card
> > checks.
>
> > Below is my verification class:
>
> > class ClientNewForm(formencode.Schema):
> > allow_extra_fields = True
> > filter_extra_fields = True
> > firstname = formencode.validators.String(not_empty=True)
> > lastname = formencode.validators.String(not_empty=True)
> > cardType = formencode.validators.String(not_empty=True)
> > cardNumber = formencode.validators.String(not_empty=True)
>
> > ccType=cardType
> > ccNumber=cardNumber
> > cc = formencode.validators.CreditCardValidator()
>
> > Essentially this results in three missing fields being show i.e
> > ccType,ccNumber and cc.
>
> > Could somebody be so kind and enlighten me on the correct syntax for
> > this method?
>
> Oh, they need to be post_validators because they operate on multiple
> fields. So make string fields for all of them, then put the credit
> card validators in post_validators.
>
> --
> Mike Orr <[email protected]>- Hide quoted text -
>
> - Show quoted text -
--
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.