A question on lists and sorting, to prepare for a template

2007-08-08 Thread drkfce
I have a views code that produces a dictionary like the one below, and I want to get them in order in accordance to the keys within the dicts; how can one do that? Example: {'Breakfast':[{'day':'1', 'main_course':'pancakes', 'beverage':'milk'}, {'day':'3', 'main_course':'cereal', 'beverage':'ora

Need a little more help with for loops

2007-07-26 Thread drkfce
When I use the below code, the first item is "treed" like it is supposed to be. However, when I try to put in additional branches at the same "level", the information from the previous loops stays, thus, when a new branch is looped, it will contain information of all branches before it. Here's a

Re: Multiple for loops, alternating between key and value?

2007-07-25 Thread drkfce
Thanks, Russ! Your solution worked fine, however, the format that I will ultimately be given is different than the one I gave you, with it being mostly dictionaries, rather than lists. Thankfully, I was able to figure out the loops enough to get the structure nearly correct, except for one thing

Multiple for loops, alternating between key and value?

2007-07-23 Thread drkfce
Hi all, first time poster, beginner Django user. RIght now, I'm trying to build a page that telnets into two or more switches, gathers the data from each switch, and puts the information into a palatable form. I managed to get the information into a format that I think is acceptable; a list of d