Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set Mapping's "uknown" attribute with MappingSchema #23

Closed
akheron opened this issue Sep 22, 2011 · 1 comment
Closed

Unable to set Mapping's "uknown" attribute with MappingSchema #23

akheron opened this issue Sep 22, 2011 · 1 comment

Comments

@akheron
Copy link
Contributor

akheron commented Sep 22, 2011

When created imperatively, I can set a Mapping's "unknown" attribute:

my_mapping = SchemaNode(Mapping(unknown='raise'))
my_mapping.add(...)

When created declaratively, there's no way to do this, though:

class MyMapping(MappingSchema):  # :(
    ...

The same applies to Sequence's "scalar" attribute and SequenceSchema.

@mcdonc
Copy link
Member

mcdonc commented Sep 25, 2012

Sorry for the extreme delay responding. The way to do this is:

themapping = MyMapping()
themapping.typ.unknown = 'raise'

This is unlikely to change unless someone comes up with a better idea.

@mcdonc mcdonc closed this as completed Sep 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants