Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 12, 2011 17:14:37

d.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ValueError.


How can I work around this ValueError: too many values to unpack.
I am actually trying to extract certain portion of a csv file.
I just need an insight into what could be causing such error and I should be
able to figure out the rest.

Thanks.
Sent from my BlackBerry wireless device from MTN

-----Original Message-----
From: "gia...@gmail.com" <gia...@gmail.com>
Sender: django-users@googlegroups.com
Date: Wed, 12 Jan 2011 18:07:30
To: <django-users@googlegroups.com>
Reply-To: django-users@googlegroups.com
Subject: Re: Follow relations on three tables

On Tue, Jan 11, 2011 at 2:30 PM, Matias Aguirre <matiasagui...@gmail.com> wrote:
> So, basically you want this:
>
> C.objects.filter(Bref__Dref__id=D_id).values_list('Aref')
>

Thanks! it was exactly what I needed

--
Gianluca Sfornahttp://morefedora.blogspot.comhttp://identi.ca/giallu-http://twitter.com/giallu--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 12, 2011 17:17:37

Shawn M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ValueError.


On Jan 12, 2011, at 12:14 PM, delegb...@dudupay.com wrote:

> How can I work around this ValueError: too many values to unpack.
> I am actually trying to extract certain portion of a csv file.
> I just need an insight into what could be causing such error and I should be
> able to figure out the rest.
>
> Thanks.
> Sent from my BlackBerry wireless device from MTN


It's exactly what the message said. Look at your line of code that attempts to
read from the CSV. It will be assigning the values to variables.

Then look at the CSV file, and you will find that the number of values in one
or more of the lines exceeds the number you were expecting.

This is a basic Python question -- not a Django one. Check out the very active
Python mailing list:http://mail.python.org/mailman/listinfo/python-listShawn

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support