From: Chuck E. <ec...@mi...> - 2000-12-14 15:42:50
|
At 04:25 PM 12/14/2000 +0100, Paul Boddie wrote: >I don't use XML here more than to specify what kind of data the >handler/servlet >is expecting. Interestingly, if one wanted to be strict about type checking in >Python itself, one would need to adopt such kinds of structure descriptions, >especially if one wanted to deal with strictly typed hierarchical structures. I do similar kinds of things, but I always use comma-separate-values (CSV) files which I edit in a spreadsheet such as MS Excel. Of course, CSV is text so everyone can deal with them if they really have two. I often have columns for name, type, min, max, isRequired, etc. I use MiscUtils.DataTable to read these files. I can then loop through the rows and treat each one like a dictionary keyed by the column names. Also, columns can specify types like "min:int" and "max:int" so I can deal with the data in a "real" fashion (e.g., I don't have to invoke things like int() and float() all the time). >Of course, there is an internal Python representation which is equivalent to >each XForm definition, but my idea is to provide a capability to separate the >type description from the handler and then use Webware to associate them. If I >could magically block direct access to the handlers then everything would be >almost perfect. Not sure what you mean by "magically block access". Are you saying the URLs that handle the data submitted from the forms should only be "invokable" from the forms? If so, perhaps some kind of special identifier passed as a hidden field would be appropriate. Especially if these were generated from some kind of algorithm that would make them transient and hard to guess. But I don't know if that's what you were referring to. >I was rather impressed that I managed to get this kind of thing working in >Webware. Just at the appropriate point in time, I found the forwarding >method in >the API, so you've certainly thought this kind of thing through in advance. You can thank Jay for that one. He was the champion for URL forwarding. > > Likewise, FormKit will do the same. > >Do you have any information on FormKit on the Webware Web site? I didn't see >anything the last time I looked. No. It's gone through 2 redesigns and I didn't want to post it while it was pre-pre-pre-alpha. I don't have a firm timeline on it right now. -Chuck |