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

SQLAlchemy Support #2439

Closed
cancan101 opened this issue Jan 20, 2015 · 22 comments

Comments

Projects
None yet
7 participants
@cancan101
Copy link
Contributor

commented Jan 20, 2015

This is a wishlist feature: support for SQLAlchemy models instead of Django ORM models.

@auvipy

This comment has been minimized.

Copy link
Contributor

commented Jan 20, 2015

will that much difficult?

@tomchristie

This comment has been minimized.

Copy link
Member

commented Jan 20, 2015

So this has been on my radar a little bit, it'd be interesting to know how much public support there would be for this. Also interested in hearing from folks...

  • Would you be expecting to use both the ORM and SQL Alchemy (eg define the models, migrations etc in standard Django but have the ability to drop down to SQL alchemy when needed) or would you be expecting to use only SQL Alchemy?
  • Specifically what support would you expect - an SQLAlchemySerializer that is equivalent to ModelSerializer? a DB auth backend that's simliar to django.contrib.auth and can give you eg login/logout views? Or a more basic, "I can use this in generic views, but I need to work with plain old serializers, and I don't get any contrib.auth type stuff for free anymore.
@tomchristie

This comment has been minimized.

Copy link
Member

commented Jan 20, 2015

will that much difficult?

Depends how comprehensive it would need to be. You can already use SQLAlchemy with Django (and by extension with REST framework), but you need to make a few tweaks eg to make Django's test case machinery still handle things correctly. It'd be a lot of work to make it all work seamlessly.

@tomchristie tomchristie changed the title SQL Alchemy Support SQLAlchemy Support Jan 20, 2015

@tomchristie

This comment has been minimized.

Copy link
Member

commented Jan 26, 2015

Given that this issue is very far away from us being in a position to actually do anything about it I'd normally consider closing it off. As it is I'll leave it open for the moment as I'd like to solicit more feedback on:

  • What folks would actually been expecting in the way of support (eg see above)
  • See if it does actually get much/any attention.

This is probably the sort of thing we'd want to consider another kickstarter for if we were going to seriously tackle it, as there's potentially a lot of work here, depending on the level of support we'd add.

@auvipy

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2015

i saw a project idea about SQLAlchemy support for django on django gsoc 2015 page. after that type of implementation it could be easier to add sqlalchemy support in drf.

@xordoquy

This comment has been minimized.

Copy link
Collaborator

commented Jan 29, 2015

DRF would get it for free then

@cancan101

This comment has been minimized.

Copy link
Contributor Author

commented Jul 28, 2015

Looks like the GSoC project was no accepted: http://www.google-melange.com/gsoc/projects/list/google/gsoc2015.

@auvipy

This comment has been minimized.

Copy link
Contributor

commented Jul 29, 2015

as no one submitted any proposal related to sqlalchemy support in django

@sloria

This comment has been minimized.

Copy link
Contributor

commented Sep 29, 2015

Or a more basic, "I can use this in generic views, but I need to work with plain old serializers, and I don't get any contrib.auth type stuff for free anymore.

This would be nice. For me, the most valuable component of Django/DRF is its view layer. At my job, we are using DRF with MongoDB and a custom ODM--no Django auth. It's working quite well, but some DRF features--such as filtering and pagination--don't work as nice without an integration layer with the ORM. Providing that integration layer for SQLA seems like a big potential win.

@auvipy

This comment has been minimized.

Copy link
Contributor

commented Oct 29, 2015

for supporting this should there a need for something like django-sqlalchemy which will be ._meta API compliant and accessible through django ORM

@auvipy

This comment has been minimized.

Copy link
Contributor

commented Oct 29, 2015

@sloria is it possible to serialize django-mongoengine with drf?

@thedrow

This comment has been minimized.

Copy link
Contributor

commented Oct 29, 2015

Yes, I think there is a drf-mongoengine package.

@auvipy

This comment has been minimized.

Copy link
Contributor

commented Nov 15, 2015

@jredd

This comment has been minimized.

Copy link

commented Aug 4, 2016

For the needs of the project I'm working on I don't have a django model of the table i'm accessing and it's just sql alchemy, since the table is defined with composite keys.

@xordoquy

This comment has been minimized.

Copy link
Collaborator

commented Aug 5, 2016

I think we should close this ticket and add a mention to djangorest-alchemy in the 3rd party packages.

@jredd

This comment has been minimized.

Copy link

commented Aug 5, 2016

I tried integrating djangorest-alchemy into my project and it didn't work.

@auvipy

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2016

@jredd the package is still incomplete

@auvipy

This comment has been minimized.

Copy link
Contributor

commented Jan 14, 2017

I spent some of my time to implement a django-sqlalchemy integration package here https://github.com/TrendBreaker/django-sqlalchemy. It need a lot of analysis and work to be ready for use.

If any one has any input you are welcome to open a issue. If that can be done the drf support will be much easier for sqla

@tomchristie

This comment has been minimized.

Copy link
Member

commented May 3, 2017

Thanks @xordoquy - have added djangorest-alchemy to https://github.com/encode/django-rest-framework/blob/master/docs/topics/third-party-packages.md

Going to close this off as it's almost certainly not something we'd cover in core.

@tomchristie tomchristie closed this May 3, 2017

@auvipy

This comment has been minimized.

Copy link
Contributor

commented May 3, 2017

That package is not ready either.

@tomchristie

This comment has been minimized.

Copy link
Member

commented May 3, 2017

Actually yes it does appear to be stalled.

@auvipy

This comment has been minimized.

Copy link
Contributor

commented May 3, 2017

yup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.