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

"Too many values to unpack" using Django 1.6 #29

Closed
8one6 opened this issue Nov 25, 2013 · 6 comments
Closed

"Too many values to unpack" using Django 1.6 #29

8one6 opened this issue Nov 25, 2013 · 6 comments
Labels

Comments

@8one6
Copy link

8one6 commented Nov 25, 2013

Hi. Just tried this out on Django 1.6 and started getting ValueError Too many values to unpack all over the place. Downgrading to Django 1.5 fixed the issue.

Any sense of how core the source of the error is? I can try to provide more context if necessary, but needed to just "fix it" tonight, which I did by downgrading Django.

@ghost ghost assigned dlo Nov 25, 2013
@dlo
Copy link
Member

dlo commented Nov 25, 2013

Thanks for the heads-up...I can't think off the top of my head what could be the source of this issue, but I can look into it. Did you happen to save a traceback?

@benmehlman
Copy link

I am currently trying to get it to work on 1.6.. The error you got is due to the following code in compiler.py

ordering, ordering_group_by = self.get_ordering()

In django 1.6, get_ordering() returns three values. I fixed that error by changing all the calls to get_ordering(), to this (in django_pyodbc/compiler.py)

ordering, o_params, ordering_group_by = self.get_ordering()

I do not know what o_params is for, I just ignore it.. which isn't good. But I'm hoping that pyodbc doesn't need it :)

But unfortunately, that's not the only problem. Now I am hung up on the next problem.. also in compiler.py, there are quite a few references to:

self.query.ordering_aliases

The query object in 1.6 has no ordering_aliases property.

Going off a hint I found online, I tried to change this to:

self.ordering_aliases

But that is a long shot.. and it still doesn't work. I really don't know what ordering_aliases are or where they come from.. and it will take me a long time to figure out. I'm an experienced programmer (30+ years) but only 6+ weeks with python and django.. so have not really had the time to learn how the db backend works too much.

But as far as the first problem goes, I'm pretty confident that my solution is ok.

-Ben

@benmehlman
Copy link

I should mention.. isql works, manage.py inspectdb works.. so the driver is loading, everything's configured correctly.. it just blows up when you try to do a query.

@vidz1979
Copy link

vidz1979 commented Dec 3, 2013

benmehlman... fork the project on github and upload your work, so other people can help you on this.

@dlo
Copy link
Member

dlo commented Dec 3, 2013

@benmehlman if you're interested in contributing, I can just give you the commit bit to this repo. I just don't have the time right now to dig into the problem in more detail.

@tax
Copy link
Collaborator

tax commented Dec 31, 2013

I believe this can also be closed. If not please reopen.

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

No branches or pull requests

5 participants