[Tutor] Dictionary within a dictionary

qsqgeekyogdty at tiscali.co.uk qsqgeekyogdty at tiscali.co.uk
Fri Jun 13 16:23:06 CEST 2008


Hi,
Following Alan's post, what I was trying to do is to understand how I 
can return the sub-item within the same space, if it makes sense ;)

For example, in my 3 one-to-many lists, I want to generate this list:

          [{'id': <group id>,
            'category': [{'id': <category id>,
                        'sub-category': [ {'id': <sub-category id>,
                                     'title': <sub-category title>,
                                     'is_selected': <True | False>
                                    }
                                  ...]
                        'title': <category title>,
                        'is_selected': <True | False>
                        }
                     ...]
            'title': <group title>,
            'is_selected': <True | False>,
            }
           ...]

Reason for this is that I want to create a navigational menu for a web 
template so that when you click on group_id the value is sent and this 
pulls the 'categories' and when you click on the category then the sub-
categories are listed.

Thanks
David



__________________________________________________________

Find out what Tiscali can do for you - http://www.tiscali.co.uk/services



More information about the Tutor mailing list