2 ms·
The Django ORM has raw SQL escape hatches (either fully raw SQL database connections or model instance selections with SQL), and if you do need the SQLAlchemy q
by akx 8y ago
The Django ORM has raw SQL escape hatches (either fully raw SQL database connections or model instance selections with SQL), and if you do need the SQLAlchemy query builder, slap in something like https://github.com/Deepwalker/aldjemy https://github.com/Deepwalker/aldjemy .
As for the initialization stuff -- yes, that's true; whenever Django models are being imported, you do need to have had `django.setup()` called.
- zimablue 8y agoyea good point, I should have mentioned the raw SQL escape hatch, that also isn't an ideal solution. I went for aldjemy/instead them and in retrospect starting with something sqlalchemy native would have been cleaner.
- c0un7d0wn 8y agoWe went the other way around and came up with https://github.com/shosca/django-rest-witchcraft https://github.com/shosca/django-rest-witchcraft and https://github.com/shosca/django-sorcery https://github.com/shosca/django-sorcery to integrate sqlalchemy with django as the project was already using sqlalchemy.