Re: Make htmlfill only apply to certain named forms
Adam Batkin <[email protected]> Mon, 01 Feb 2010 18:42:23 +0000
| Newsgroups | gmane.comp.python.formencode |
|---|---|
| Message-ID | <[email protected]> |
>> Attached is a proposed patch that adds this ability. My initial testing has >> found that it works pretty well. > > Can you add some tests for the change into your patch? htmlfill.render > is a pretty busy place and could use the testing attention. Agreed. >> It adds an optional argument to htmlfill.render(): form_name >> >> If a form_name is not passed, htmlfill should act exactly the same as >> before. If a form_name IS passed however, htmlfill will only ever touch the >> named form (plus any unnamed forms, though I'm not sure if this is a >> idea). > > I think your instincts are on target with regard to unnamed forms. > Probably it's best to ignore them if a named form has been specified > explicitly. Anyone else agree with this statement? I do too, but I wanted to leave the default behaviours as much as possible. Or it could be another option. But no. > Adding another optional parameter is the standard mechanism for adding > configurable behaviour to htmlfill.render, but that parameter list is > getting awfully long. Does anyone have any ideas about breaking > rendering up a little bit? I suppose there is an advantage of named parameters though: If you like the defaults, you don't need to pass any. They sure beat positional parameters. Actually, I was thinking of adding one additional [mutually exclusive] parameter: form_id. That way it could identify the form by either the name attribute or the id attribute. But it would otherwise work identically to the form_name attribute. So, is this something that is interesting to the wider community? In particular, is this something that has the potential to be merged in? Thanks, -Adam Batkin ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com