-
Notifications
You must be signed in to change notification settings - Fork 11
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
Data not being commited to database #48
Comments
Looks like you're missing the middleware to commit. You can use SQLAlchemyDBMiddleware from django-sorcery. Something simple like class MyMiddleware(SQLAlchemyDBMiddleware):
db = session and register that in |
Whats the difference between this project and django-sorcery? |
django-sorcery does django and sqlalchemy integrations, django-rest-witchcraft does drf integrations. django-sorcery is a dependency of django-rest-witchcraft as they mostly deal with similar things, like mapping model metadata to a model form or model serializer. |
I would only add that you can use |
@miki725 he can't actually, he's not using |
ah yes. didnt pay close attention to the actual code example. I guess this could a great opportunity to advertise sorcery and its magical abilities 😄 sorcerified db allows for use models somewhat django-like with things like |
Yes!, you can declare sqlalchemy models with django-like syntax: class Owner(db.Model):
query_class = OwnerQuery
id = db.IntegerField(autoincrement=True, primary_key=True)
first_name = db.CharField(length=50)
last_name = db.CharField(length=50) see https://github.com/shosca/django-sorcery/blob/master/tests/testapp/models.py for more details. |
Very nice, maybe i will do a PR improvig the documentation after i get it all working, i like django and i like sqlalchemy. I think this lib is going to be perfect for my new architecture. |
I got a problem using this implementation. All insert queries happens on the console correctly. However, the commit is not being called and data never gets flushed into the database.
Am i missing something?
The text was updated successfully, but these errors were encountered: