[Twisted-web] Re: Re: new nevow know-how needs...;-)
Stephen Waterbury
twisted-web@twistedmatrix.com
Sat, 06 Mar 2004 17:03:35 -0500
James Y Knight wrote:
> On Mar 6, 2004, at 3:57 PM, Stephen Waterbury wrote:
>
>> Aren't you confusing variable names with values? I would think
>> what you cite here would only be a problem if what was called
>> "usernames" was later called "title" -- which would be a problem
>> in any event.
>
> No -- given a page with the following functions:
>
> def data_users(context, data):
> return {'foom': 'James Knight", 'mg': 'Matt Goodall', 'title': 'Bogus
> User'}
> def data_title(context, data):
> return "My Title"
>
> You ask it to render this:
> <span data="users"><span data="title">.....</span></span>
>
> First, it will lookup the child 'users' from the current data (the Page
> instance). This will be the function data_users, which will be called,
> and return the dictionary. Now, the current data is the abovementioned
> dict. Now, it looks up the child 'title' from the current data (the
> dict). This will return 'Bogus User', which is not at all what you wanted!
Thanks, James -- I see now, and I appreciate your patience! :)
I must say that for me this is rather non-intuitive.
Cheers,
Steve