[albatross-users] <al-lookup> thoughts

Andrew McNamara andrewm at object-craft.com.au
Wed Aug 14 14:09:35 EST 2002


I'm currently using an <al-lookup> table in the popview application when
displaying mime messages - we look up the mime type to get to appropriate
rendering method.

The problem is, there are a bunch of mime types that share a common
rendering method. I could have a dict that mapped from mime type to
rendering method, but it would seem to be more sensible to have some
way of representing this in the template.

One thought that occured to me is that if the <al-item expr="...">
returned a list, we could add each list item to the lookup dictionary:

   <al-item expr="['image/gif', 'image/jpeg', 'image/png']">
    ...
   </al-item>

It might also be useful to be able to do things like this:

   <al-lookup name="foo">
    <al-item expr="foo.startswith('image/')">
     ...

We'll obviously have to iterate, rather than using a dictionary in cases
like that. And my suggested syntax needs more thought.

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/



More information about the Albatross-users mailing list