[albatross-users] al-values inside al-input

Dave Cole djc at object-craft.com.au
Fri Jan 31 11:37:56 EST 2003


>>>>> "Gregory" == Gregory Bond <gnb at itga.com.au> writes:

>> * Implement a generic tag class to handle all tags that are not
>> currently Albatross tags.

>> * Inside Albatross tags we would implement functionality which
>> processes any attribute which is prefixed by 'al-' as a Python
>> expression.

Gregory> Whoa, that's much more ambitious than I had in mind.... and
Gregory> it would probably change the way things are done with
Gregory> albatross templates quite dramatically. I fear for backwards
Gregory> compatibility in this case.

Where the current nameexpr, valueexpr, ... attributes are identical to
the behaviour proposed by the al- attributes, the current attributes
would be retained for backwards compatibility.

By adding the new behaviour we would not be breaking anything which
currently exists, we would just be adding a more consistent scheme for
doing the same thing while providing the capability to any other tag.

Gregory> I was considering something a bit more modest:

Gregory>  - Each al- tag class already knows what attributes they are
Gregory> interested in.

Gregory>  - The tag classes use has_attrib() and get_attrib() to
Gregory> access them

Gregory>  - These two functions (and others like
Gregory> write_attribs_except()) can be changed to look up "foo", and
Gregory> if that doesn't exist, look up & evaluate "fooexpr".

Gregory>  - This could be pretty much backward compatible to
Gregory> applications, tho the tag classes would need a bit of work.
Gregory> Leave alone the expr attributes (al-value et al), remove the
Gregory> special case handling of nameexpr, valueexpr etc (lots of
Gregory> places) and let the default mechanism kick in.

You might be right.  We have not done much more than speculate on a
scheme which might reduce the current complexity of templates and
their collection of individually handled attributes.

The code to implement the generic stuff might be too nasty to be worth
it.

- Dave

-- 
http://www.object-craft.com.au




More information about the Albatross-users mailing list