durusmail: qp: RFC to Form to help form formating
RFC to Form to help form formating
2006-11-19
RFC to Form to help form formating
Tristan Short
2006-11-19
This may be redundant but I have found the need to amend the Widget class in qp
to include a self.render_first(...) and a self.render_last(...) pair of methods.
This is to enable me to pass in at initialisation, first="< some formatting html
>" and last="< some more html>" to aid with the physical layout of form fields
in the rendered page. The simple addition of these two methods to the Widget
base class and the implied update to the self.render() method using the existing
pattern used for self.render_hint() provides a high degree of control over my
form layout, i.e. I can place form widgets within tables etc. Maybe the right
way to do this is with css but it is a lot easier to see what is going on in the
code this way. Here is my Widget.render(self) method:

def render [html] (self):
    self.render_first(self.get_first())         # vehicle to add formatting html
    classnames = '%s widget' % self.__class__.__name__
    '\n
' % ( self.get_name(), classnames) self.render_title(self.get_title()) '\n
\n' self.render_content() self.render_hint(self.get_hint()) self.render_error(self.get_error()) '\n
' '
' '
' self.render_last(self.get_last()) # vehicle to add formatting html What do you think, and could it make it into a future release of qp, or is there better way? Regards, Tristan
reply