Skip to content

increase serializer compatibility to django 1.8 #2857

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

Merged
merged 1 commit into from
May 4, 2015

Conversation

w-
Copy link

@w- w- commented Apr 22, 2015

i ran into this issue when using v2.4 with django v1.8. (i didn't previously read it isn't supported)
It's not in the release notes but django.db.model.Options many_to_many() now returns an ImmutableList which is really just a tuple with a bunch of warnings and hooks on it.

if we don't make this typecast change we get the following error

TypeError: can only concatenate tuple (not "list") to tuple

I'm not sure if this change is appropriate and not sure what, if any, additional tests to include with this .

I attempted to test this but must be doing something wrong.
Every test fails when trying to use cursor. most of the errors I get are

 Failed: Database access not allowed, use the "django_db" mark to enable

i followed the instructions here.
https://github.com/tomchristie/django-rest-framework/blob/version-2.4.x/CONTRIBUTING.md


i ran into this issue when using v2.4 with django v1.8. (i didn't previously read it isn't supported)
It's not in the release notes but django.db.model.Options many_to_many() now returns an ImmutableList which is really just a tuple with a bunch of warnings and hooks on it.

if we don't make this typecast change we get the following error

TypeError: can only concatenate tuple (not "list") to tuple

I'm not sure if this change is appropriate and not sure what, if any, additional tests to include with this .

I attempted to test this but must be doing something wrong.
Every test fails when trying to use cursor. most of the errors I get are

 Failed: Database access not allowed, use the "django_db" mark to enable

i followed the instructions here.
https://github.com/tomchristie/django-rest-framework/blob/version-2.4.x/CONTRIBUTING.md
@xordoquy
Copy link
Collaborator

Actually, the django.db.models.Options is private API so there's no guarantee it'll be in the release notes. Moreover, this was changed as part of the Meta API changes which are explained in the release notes.
Back on the topic, I'm ok with merging this. Just need to discuss a bit the process around the 2.4 PR and I'll merge it.

@w-
Copy link
Author

w- commented Apr 22, 2015

cool. great to hear. look forward to the merge. thanks.

@arpheno
Copy link

arpheno commented May 4, 2015

Just dropping by to express my anticipation for this merge as well :) keep up the good work.

xordoquy added a commit that referenced this pull request May 4, 2015
increase serializer compatibility to django 1.8
@xordoquy xordoquy merged commit 9926241 into encode:version-2.4.x May 4, 2015
@riklaunim
Copy link

Now that's what I was looking for :) legacy API should be happy now...

nikolas added a commit to ccnmtl/wacep that referenced this pull request Aug 24, 2015
nikolas added a commit to nikolas/django-rest-framework that referenced this pull request Aug 24, 2015
Might be useful for catching any more django 1.8 issues like this one:
encode#2857
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants