durusmail: quixote-users: Patch: add html_attrs keyword arg to widget classes
Generalizing form/widget API a bit
2003-11-25
2003-11-25
2003-11-25
2003-11-25
2003-11-25
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-29
2003-11-30
2003-11-26
2003-11-26
2003-11-26
Patch: add html_attrs keyword arg to widget classes
2003-11-30
Patch: add html_attrs keyword arg to widget classes
2003-12-01
Patch: add html_attrs keyword arg to widget classes
2003-12-01
Patch: add html_attrs keyword arg to widget classes
2003-12-01
2003-12-02
2003-12-03
2003-12-02
Patch: add html_attrs keyword arg to widget classes
2003-12-01
Patch: add html_attrs keyword arg to widget classes
2003-12-01
Patch: add html_attrs keyword arg to widget classes
Michael Watkins
2003-12-03
On Mon, 2003-12-01 at 18:35, Greg Ward wrote:
> On 01 December 2003, Neil Schemenauer said:
> > Here's another proposed patch.  The basis is:
>
> Hot dog.  Looks like the best one so far (although I haven't
> tested it yet!).

Had to manually apply part of the patch, looking very good. Casual
testing found ButtonWidget only partly upgraded - render is missing the
new kwattrs.


in ButtonWidget

    def render(self):
        value = (self.label and htmlescape(self.label) or None)
        return htmltag("input", xml_end=True, type=self.HTML_TYPE,
                    name=self.name, value=value)

should end with:

                       name=self.name, value=value, **self.attrs)


How very nice to be able to pass stuff like onClick="return(somecode())"
with ease now...


--
Mike Watkins
mw@mikewatkins.net


"On two occasions I have been asked [by members of Parliament!], `Pray,
Mr.  Babbage, if you put into the machine wrong figures, will the right
answers come out?'  I am not able rightly to apprehend the kind of
confusion of ideas that could provoke such a question."
                -- Charles Babbage


reply