Colander doesn't provide a way to use another node's value as the default value for a missing node, afaik. Instead, I recommend you deserialize the data first. Once it's been validated against your schema, you can go back through your structure and determine what the missing field values should be.
-Vincent On Wed, Jan 15, 2014 at 5:27 PM, Keith Brown <[email protected]> wrote: > Hi, > > I am using colander to validate a yaml file. > > The file looks like this > > main: > color:White > > cars: > Car1: > - Brand:"Honda" > - color:Red > Car2: > - Brand:"Toyota" > > Since Car2 does not have a color specified I want to inherit "main's" > color (white). Can colander do this, do shall I deserialize the object, > update the dictory and then serialize it for colander again? > > > > > -- > 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]. > Visit this group at http://groups.google.com/group/pylons-discuss. > For more options, visit https://groups.google.com/groups/opt_out. > -- Vincent Catalano Software Engineer and Web Ninja, (520).603.8944 -- 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]. Visit this group at http://groups.google.com/group/pylons-discuss. For more options, visit https://groups.google.com/groups/opt_out.
