On Tue, Jan 19, 2010 at 1:16 AM, Pablo Antonio <[email protected]> wrote:
> Hi Angelo,
>
> On Fri, Jan 15, 2010 at 05:21:46PM -0800, Angelo Gladding wrote:
>> Use anand's 
>> unflatten<http://github.com/openlibrary/openlibrary/blob/master/openlibrary/plugins/upstream/utils.py#L115>(updated
>> link) like so:
>>
>> >>> inp = unflatten({'data--1--age': 18, 'data--1--name': 'John Doe',
>> 'data--2--age': 22, 'data--2--name': 'Jane Doe'})
>> >>> inp.data[0].age
>> 18
>> >>> inp.data[1].name
>> 'John Doe'
>
> Yes, thank you. The line number the old link referred to was confusing.
> Now I know what's the function Anand was talking about.
>
> What about including something like this in the framework? Would that
> against web.py's "keep it simple" philosophy?

That can possibly go to utils.py.
Will it be better to support "data[1][age]" format instead of "data--1--age"?
-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.


Reply via email to