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

Allow using SQLAlchemy model classes as input/output parameters #892

jsabater opened this Issue Oct 11, 2018 · 0 comments


1 participant
Copy link

jsabater commented Oct 11, 2018

When developing resource-bases methods or services, it would be very useful to be able to let SimpleIO input/output parameters work with schema classes, as it would save repeating definitions that already exist in the model.


from mymodel import UserModel

class SimpleIO:
  input_required = 'id'
  output_required = UserModel
from mymodel import UserModel

class SimpleIO:
  input_required = UserModel, 'another_attr1', 'another_attr2'
  output_required = 'is_success'

So, for instance, if an atribute of UserModel has a default value, SimpleIO could already fall back to such default value when creating a new record. Types could also be taken from the columns in the model.

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