On Tuesday, 18 December 2012 21:17:18 UTC+7, kusut wrote:
>
> if arbitrary:
>     node.children = [
>         child for child in self.children
>         if child.name in data
>     ]
>
> # where data is some struct like request.POST
>

More explanation

So your phone schema now might look like this:

class Phone(colander.MappingSchema):
    location = colander.SchemaNode(colander.String(),
                                  validator=colander.OneOf(['home', 'work']))
    number = colander.SchemaNode(colander.String())

    type = colander.SchemaNode(colander.String())

    provider = colander.SchemaNode(colander.String())
    # .. and more

Now you have to define what fields are accepted, but you will not try to 
deserialize them if they're missing (in my case, I raise Invalid if all of them 
is missing).

Hope I understand your problem right

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pylons-discuss/-/ylBJ6YkGfekJ.
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