Hi,
you may use peppercorn for this purpose :
import peppercorn
controls = request.params.items()
values = peppercorn.parse(controls)
try:
appstruct = schema.deserialize(values)
except colander.Invalid as e:
logger.exception(u"An error occured")
Hope this help,
Regards
Gaston
Le 08/06/2016 à 13:15, Andrius Kulbis a écrit :
> I started using colander in my pyramid project. Created a simple data
> model mapping using colander
> |
> classDataModel(colander.MappingSchema): user_count
> =colander.SchemaNode(colander.Integer()) expiration_date
> =colander.SchemaNode(colander.Date()) comment
> =colander.SchemaNode(colander.String())
> |
>
> How can I pass submited form data to this mapping ir order to validate
> it without using deform? Is it possible to iterate over a validation
> errors?
>
> |
> model =DataModel()
>
> if'submit'request.POST:
> form_data =request.POST.items()
> ???
> |
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pylons-discuss/991aaa8d-f540-4dc1-a32a-c72aad959e7c%40googlegroups.com
> <https://groups.google.com/d/msgid/pylons-discuss/991aaa8d-f540-4dc1-a32a-c72aad959e7c%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pylons-discuss/c3b0d8e0-d4e9-c689-16c3-4d72c5974dbe%40gmail.com.
For more options, visit https://groups.google.com/d/optout.