[albatross-users] impedance mismatch 1

Eric S. Johansson esj at harvee.org
Wed Jul 2 08:45:30 EST 2003


I'm reading the documentation and here is my commentary based on where I feel I 
get that slack-jawed look on my face.

http://www.object-craft.com.au/projects/albatross/albatross/tug-simple3.html

section 3.3 "introducing albatross tags"

after the body of code shown, there is a paragraph starting with "the following 
lines construct a sorted list..."

The description of locals leaves me puzzled.  Its behavior is counter to 
everything I have learned in Python to date.  It's this magic data lint trap 
that doesn't behave like a class, a dictionary, a list or anything else I'm 
familiar with.

But I guess I can sort of deal with the dissonance by just assuming that 
context.locals can magically absorb data and associate it with a statically 
supplied name.

quite frankly, most of the discussion about local and global name spaces just 
goes in one ear and out the other because it just doesn't seem important to the 
problem on hand of figuring out how to transfer data from the local context to 
the template context.

Now comes the templates and I get really confused.

expr=name.value()

brings an exclamation of wth?? to my lips.  Why isn't it just name?  what 
happened to the ctx.locals?  Eventually I just shrug and figure it's for some 
hopefully documented reason.  But the next line really brings wrinkles to my brow

expr="environ[name.value()]"

after all if name needs a .value() function why isn't it

expr="environ[name.value()].value()"

seriously grump inspiring.

I think the rest of the explanation with separating out presentation logic and 
the use of the al-exec tag is pretty good.  the only rough spot is comes with 
the description of the "locals" data lint trap.

---eric






More information about the Albatross-users mailing list