[albatross-users] Select tag

Andrew McNamara andrewm at object-craft.com.au
Fri Feb 14 14:50:55 EST 2003


>While working on an extension of the select tag, I noted that if I
>passed a nameexpr attribute, it was bombing at lines 293-4 of tags.py
>and raising the error reflected in the source code below:
>
>        if not self.has_attrib('name') and not self.has_attrib('alias'):
>            self.raise_error('missing "name", "nameexpr", or "alias"
>attribute')
>
>I changed the block to:
>
>        if not self.has_attrib('name') and not
>self.has_attrib('nameexpr') and not self.has_attrib('alias'):
>            self.raise_error('missing "name", "nameexpr", or "alias"
>attribute')

Looks like you're using an old version of Albatross - version 1.01 fixed
this bug.

>I also noted that the code in question bombed even though it was listed
>between <al-comment></al-comment> tags.

Yep - <al-comment> is a tag like any other, and parsing continues inside
the tag, but no output is generated. So it's not really a "comment"
tag, but I needed something that prevented enclosed text being output
(the HTML comment <!-- blah --> stuff appears in the output). I guess
the doco needs to be updated... 8-)

>I had the code on one system that didn't try to parse what was between the
>comment tags.  This behavior began when I moved the code to another
>system.  The first was running python 2.2.1 and the second 2.2.2.
>Consider the following two nearly identical chunks of code:
[...]
>File "/usr/local/lib/python2.2/site-packages/albatross/template.py",
>line 63, in raise_error raise TemplateError('%s:%s: %s' %
>(self.filename, self.line_num, msg)) TemplateError:
>/path/to/stuff/templates/ballot.html:14: missing "name", "nameexpr", or
>"alias" attribute=20
>The second works like a charm. Is this possibly a python version issue?

I'm guessing the second has Albatross 1.01 installed...

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



More information about the Albatross-users mailing list