Graham Dumpleton
grahamd at dscpl.com.au
Thu Oct 21 19:37:43 EDT 2004
On 22/10/2004, at 8:20 AM, Damjan wrote: >> A question on what people perceive as being best practice as far as >> dealing >> with forms when using mod_python. > > How about this: > You have the FORM spec in an XML file with the [lets say] .pyfrm > extension. This extension is associated with a special mod_python > handler [mod_python.form]. Personally, I'm not a fan of all these different magical extensions people have come up with just to satisfy mod_python's way of working out which handler to use. One of the main issues is that it exposes within the URL the particular implementation mechanism being used. Now, whether or not the form mechanism is driven by XML, by Python data structures or programmatically, at its basic level it should be usable as a library without any restriction that it will only work within the confines of a particular framework. If you want to then wrap it in an additional layer so that the above is possible, fine. Anyway, there seems to have been ample prior work on forms validation support for Python. Ie., see: http://toulouse.amber.org/archives/2003/09/03/ python_form_and_validation_kits.html Probably a good place to start for doing an evaluation of what is out there. Some look specific to particular frameworks, but others aren't. Oh, the FormEncode link isn't really any longer valid, see: http://formencode.org/ If there is a good library out there already for doing this, better off just using that than starting from scratch. -- Graham Dumpleton (grahamd at dscpl.com.au)
|