"Steve Bergman" <[EMAIL PROTECTED]> writes:
> Thanks Jorge and David. That helps a lot. I'm not exactly new at
> Python, but newish, and it takes me a lot longer to learn new languages
> than I'd like, but I keep trying. I guess when I've used
> packing/unpacking before the objects have always happened to be scalar.
> zip() looks like exactly what I need.
Sometimes it takes me a while as well... :-) Specially when I build my
objects liek this:
data = [[object.id, object.something] for object in model.Class.select()]
;-) Note that here will be a list of lists, i.e., each element of the list
will be a list with other two elements. This works like you wanted:
for id, something in data:
...
What zip is doing is creating a list of lists (of tuples, in fact...). :-)
--
Jorge Godoy <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---