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

How to serialize objects #18

Open
mjallday opened this issue Nov 5, 2014 · 2 comments
Open

How to serialize objects #18

mjallday opened this issue Nov 5, 2014 · 2 comments

Comments

@mjallday
Copy link
Contributor

mjallday commented Nov 5, 2014

Colander does not support serializing an object to its json representation

Maybe pez, schematics or marshmallow

@mahmoudimus
Copy link

My vote is for schematics.

@mjallday
Copy link
Contributor Author

Looks like schematics would require a little work.

https://github.com/schematics/schematics/blob/development/schematics/transforms.py#L58

it wants everything to inherit from a base class, but what you actually want is a library that can map from one set of objects to another. if you look at how the sqlalchemy plugin works it's quite gross.

class Person(Base):

    __tablename__ = 'person'

    _id = Column('id', Integer, primary_key=True)
    _name = Column('name', String(50))

    id = IntType(default=1)
    name = StringType()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants