Re: not sure how to unpack a list within a tuple within another list inside the template

2012-01-12 Thread Mario Gudelj
Thanks for your help guys. I ended up creating a class for for orders and customers class and then I passed those objects to the tepmlate inside a dict. That worked. Cheers, On 12 January 2012 21:55, Masklinn wrote: > On 2012-01-12, at 11:47 , Daniel Roseman wrote: > >

Re: not sure how to unpack a list within a tuple within another list inside the template

2012-01-12 Thread Bill Freeman
Mario, While there are syntaxes for doing this sort of thing in the template language, I would expect the template to start looking messy, and be hard to maintain. May I suggest that you wrap this stuff in a class to provide attribute like access to the data that you need? This puts the access

Re: not sure how to unpack a list within a tuple within another list inside the template

2012-01-12 Thread Masklinn
On 2012-01-12, at 11:47 , Daniel Roseman wrote: > However I'm confused by your initial description. What you show is not a > dict at all, but a list of 2-tuples (each containing a string and a list). > Is that a single value of the dict, or what? I'm guessing it's the initialization vector for

Re: not sure how to unpack a list within a tuple within another list inside the template

2012-01-12 Thread Masklinn
On 2012-01-11, at 22:33 , Mario Gudelj wrote: > Hi Djangoers, > > I have a default dict variable final_d = defaultdict(list) that looks like > this: > > [(order1, [customer2, customer1]), (order2, [customer3, customer5, > customer6]) ] DefaultDicts are dicts, when you iterate over dicts directly

Re: not sure how to unpack a list within a tuple within another list inside the template

2012-01-12 Thread Daniel Roseman
On Wednesday, 11 January 2012 21:33:48 UTC, somecallitblues wrote: > > Hi Djangoers, > > I have a default dict variable final_d = defaultdict(list) that looks like > this: > > [(order1, [customer2, customer1]), (order2, [customer3, customer5, > customer6]) ] > > I've tried everything possible

not sure how to unpack a list within a tuple within another list inside the template

2012-01-11 Thread Mario Gudelj
Hi Djangoers, I have a default dict variable final_d = defaultdict(list) that looks like this: [(order1, [customer2, customer1]), (order2, [customer3, customer5, customer6]) ] I've tried everything possible inside the template and I can't unpack this thing. I'm passing final_d to the template