|
From: Luke O. <lu...@me...> - 2003-04-10 00:39:22
|
Damn, one little typo... here's the corrected version, that
works with original AND new functionality. :)
- Luke
def html():
...
if options.get('repeat') and options['repeat'] > 1:
assert self._repeatable, "You must indicate a field
is repeatable when it is defined"
out = [html.input(type="hidden",
name=suffixMap(".repetitions",nameMap)(self.name()),
value=options['repeat'])]
if type(defaultValue) is not ListType:
# build list of defaults...
# this might be considered list-comp abuse.
defaultValues = \
[defaultValue for x in range(options['repeat'])]
else:
assert len(defaultValue) == options['repeat']
defaultValues = defaultValue
for i in range(options['repeat']):
nm = suffixMap(".%i" % i, nameMap)
out.append(self.htWidget(defaultValues[i], options,
nameMap=nm))
return out
--
Many people are hamstrung by things like affection for
fellow employees, honesty, desire to appear to be a
"nice person," and other crippling limitations not
suffered by the truly powerful and successful.
|