[SQLObject] form generation/validation
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Jamie H. <ma...@ja...> - 2004-10-25 09:56:12
|
Hi, I was just wondering what kind of state integration with FormEncode was in? I started writing code to generate forms from (and validate forms against) SQLObject schemas myself, then I realised it was a future goal for SQLObject. From reading the FormEncode docs it seems that it will read form specifications from schemas but it doesn't mention SQLObject schemas. Is there any useable code out there? The were two problems in generating/validating forms with my implementation that I might as well mention whilst i'm here, to see what you think. The first problem was ordering - i'd like to keep the generated form fields in the same order as they appear in the schema. This _columns dictionary didn't preserve this order and from looking at the code it would seem that this is unavoidable? I ended up creating a separate list of COL objects which preserved the order and using that to generate forms. The second "problem" was generating a readable name for fields in forms (I generate a table with prompts next to each field), which I just did by adding a property to the columns - prettyName. So far i'm generating forms well enough, and i'm just about to start validation code. So I guess the point of my long rambling email is to see if any of this has been done already and if I can get hold of that code, and if not if I can help out by making my code fit your goals. Thanks for your work on SQLObject, Jamie Hillman |