Ian Bicking wrote:
> > This change doesn't fit my usage scenario. What I have is like this :
> >
> > a=dict(a set of keyword string values from web page)
> > s_a = schema(build from SQLObject data validators)
> > s_b = schema(a subset of fields in a, that is not in s_a)
> >
> > I want to validate:
> >
> > o = s_a.to_python(a)
> > o = s_b.to_python(o)
> >
> > That is, fill in o in sequence. The problem is, s_a may contains fields
> > not in a and I just want it to be skipped as a can be just a subset of
> > s_a fields. The current if_key_missing still force me to fill in
> > something for keys that I have no interest in this sequence or that it
> > may be specified in s_b.
>
> That sounds like you want allow_extra_fields=True,
> filter_extra_fields=False.  That will ignore, but pass through, any keys
> that are not defined in the schema.
Yes. that part I understand. But it is the missing keys in s_a that is
causing me trouble because validating a against s_a would fill in
fields in s_a to the output(with this if_key_missing feature) but I
don't want it. As I may fill it in later with s_b. Of course, I can
give it some special value to signify it but that may not pass the
validator of s_a.

Reply via email to