Re: [Tutor] Dictionary within a dictionary

2008-06-14 Thread Kent Johnson
On Fri, Jun 13, 2008 at 10:23 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > 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 ;) Um, no, not to me. Is your question about creating a structure or acces

Re: [Tutor] Dictionary within a dictionary

2008-06-14 Thread [EMAIL PROTECTED]
Hello, Thank you for the replies. I wanted to hold the data in memory, because the number of records do not warrant the need to have to maintain an additional relational database. Plus I wanted to understand how to build this using classes as this will perhaps give me the bridge I require to mo

Re: [Tutor] Dictionary within a dictionary

2008-06-13 Thread Alan Gauld
"Marilyn Davis" <[EMAIL PROTECTED]> wrote When see nested builtin data structures, I always think it's time to think of making a few classes instead. It could be, especially if you are about to write a bunch of functions to access those structures. But equally if the structures accurately re

Re: [Tutor] Dictionary within a dictionary

2008-06-13 Thread Marilyn Davis
On Fri, June 13, 2008 7:23 am, [EMAIL PROTECTED] wrote: > 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: When see nested bui

Re: [Tutor] Dictionary within a dictionary

2008-06-13 Thread [EMAIL PROTECTED]
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': , 'category': [{'id': , 'sub-c

Re: [Tutor] Dictionary within a dictionary

2008-06-13 Thread Kent Johnson
On Thu, Jun 12, 2008 at 7:56 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > I would like to understand how to generate dictionaries based on other > dictionaries. For example, I have a 3 tables in ym SQL database - > Groups, Categories and Sub-categories with a one-to-many relations > bet

Re: [Tutor] Dictionary within a dictionary

2008-06-12 Thread Alan Gauld
<[EMAIL PROTECTED]> wrote I am presuming that each of these tables is one of my dictionaries?!?! What I don't understand is how to write this SQL statement in python code: SELECT id, category from Categories WHERE group_id = "1"; SQL is designed(and optimised) for doing complex data querie

[Tutor] Dictionary within a dictionary

2008-06-12 Thread [EMAIL PROTECTED]
Hi, I would like to understand how to generate dictionaries based on other dictionaries. For example, I have a 3 tables in ym SQL database - Groups, Categories and Sub-categories with a one-to-many relations between each. I am presuming that each of these tables is one of my dictionaries?!?! W