[albatross-users] <al-input> and zero's

Andrew McNamara andrewm at object-craft.com.au
Tue Nov 19 10:10:52 EST 2002


>It doesn't look like albatross handle ints with a value of zero.  The
>following shows the problem...
[...]
>One would expect that zero would be <input name="zero" value="0">.
>I've been trying different things, but cannot seem to find a way for
>albatross to set a value to zero.

Oops. That's a bug - here's a one line fix:

diff -u -r1.99 tags.py
--- tags.py     4 Sep 2002 14:07:10 -0000       1.99
+++ tags.py     18 Nov 2002 23:08:55 -0000
@@ -122,7 +122,7 @@
         name, value = self.get_name_and_value(ctx)
         if name:
             ctx.write_content(' name="%s"' % name)
-        if value:
+        if value is not None:
             ctx.write_content(' value="%s"' % escape(value))
         ctx.input_add(self.__itype, name, value, self.has_attrib('list'))
 


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



More information about the Albatross-users mailing list