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

Set schema partial attribute in Meta class #453

Open
alexphi314 opened this issue Aug 3, 2022 · 2 comments
Open

Set schema partial attribute in Meta class #453

alexphi314 opened this issue Aug 3, 2022 · 2 comments

Comments

@alexphi314
Copy link

Is it possible to set the schema.partial attribute in the Meta class for SQLAlchemyAutoSchemas?

I would like to use SQLALchemyAutoSchemas with frameworks that don't allow me to set partial=True in the load_instance call (because it is done automatically) -- that setting is inherited from the schema definition. It seems like it might not be possible to set partial=True for a SQLAlchemyAutoSchema directly.

If this is not possible, could the Meta class be improved to support this?

@zedrdave
Copy link

zedrdave commented Aug 14, 2023

Any update on this?

Due to another limitation of ma-sqla (multiple variations on a schemas will trigger a naming collision warning), it is not really practical to use MySchema and MySchema(partial=True) in the same REST API (having both is a typical pattern to support CRUD endpoints).

But as mentioned above, defining a class MySchemaPartial(MySchema) that sets partial = True in Meta does not seem to work…

Edit: Possibly related (and dependent) on: marshmallow-code/marshmallow#2103

@lafrech
Copy link
Member

lafrech commented Sep 10, 2023

Yes. Let's tackle this in marshmallow-code/marshmallow#2103 first.

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

3 participants