Hi @all.
Given this data (ordered list of tuples):
0    'a'
1    'b'
2    'c'
1    'd'
2    'e'
2    'f'
3    'g'
1    'h'


the first value is "how many level should I go down", the second is the 
actual data. 
Every row's first value has a following first value that is:
- equal to previous
- previous + 1
- less than previous (up to 0)

My spider senses kinda suggest me that it's enough to make a nested dict 
like 

Surely it's easy to print out something like
a
-b
--c
-d
--e
--f
---g
-h
but I can't force my powers to produce a nice python code out of this.
If you don't like nested dicts, a nested tuple, or a nested list are fine 
too. They just need to be easily iterable, top-down, e.g.
{
'blob' : 'a',
'under' : [
    {'blob' : 'b',
     'under' : [
        {'blob' : 'c'}
        ]
    },
    {'blob' : 'd',
     'under' : [
        {'blob' : 'e'},
        {'blob' : 'f',
         'under' : [
            {'blob' : 'g' }
            ]
        }
        ]
    },
    {'blob' : 'f' }
]
}


Someone cares to enjoy a little bit ? ^_^ 

Feel free to ask any questions.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to