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

More flexible type conversion. #147

Open
leorochael opened this issue Nov 1, 2013 · 1 comment
Open

More flexible type conversion. #147

leorochael opened this issue Nov 1, 2013 · 1 comment

Comments

@leorochael
Copy link

leorochael commented Nov 1, 2013

Suppose I have a subclass of list or another class with the same "interface" (say, PersistentList from ZODB). There doesn't seem to be simple way to have a SequenceSchema deserialize to it.

First I have to create a colander.Sequence subclass, override the _impl method, call super, then convert the result to PersistentList before returning it. Then I have to set this colander.Sequence subclass as the schema_type attribute of a SequenceSchema subclass.

It would be nice to have a concrete_class (or concrete_factory) attribute/parameter that could be passed to SchemaNode, which would then be passed to the schema_type constructor which would use it as the constructor of the desserialized appstruct.

@sighalt
Copy link

sighalt commented May 23, 2017

+1 though it seems we are the only two people wishing this feature :(

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