[Twisted-web] how to make form input description dynamic with
andrea at cpushare.com
Sat Dec 4 21:48:54 MST 2004
Am I ok doing this? Is this supposed to break quickly in the future or
can it be considered sort of stable interface? Note that if it breaks
completely it's probably ok, I just don't want silent breakage with
slightly altered behaviour. I'm feeling quite safe and it seems still
cleaner than using the manual form mode.
def render_form(self, ctx, data):
configurable = self.locateConfigurable(ctx, '')
binding = configurable.getBinding(ctx, 'xxx')
ppp = filter(lambda x: x.name == 'ppp', binding.arguments)
ppp.description = '%s' % time.time()
The argument name is 'ppp' and the callback (aka MethodBinding) is 'xxx'.
More information about the Twisted-web