[EMAIL PROTECTED] wrote:
IMO, the easiest and the cleanest way is not have turbogear handle the
validating. It is unnatural and I found it to be useless if I want to
do anything that is useful. Just receive the params as kwargs(which
cherrypy would support no matter what change will be there) then
validator it using schema or whatever within the handler.
One thing that I would like to see is for the passing of args as **kwds
to become standard in TG. I write many, many lines of code that look like:
def functionname(
aaa='',
bbb='',
ccc=''
ddd=''
eee=''
fff=''
ggg=''):
followed further down by:
ret = dict(
aaa=aaa
bbb=bbb
ccc=ccc
ddd=ddd
eee=eee
fff=fff
ggg=ggg
)
followed a little further down, by:
Person = Person.get(PersonId)
ret = dict(
aaa=Person.aaa
bbb=Person.bbb
ccc=Person.ccc
ddd=Person.ddd
eee=Person.eee
fff=Person.fff
ggg=Person.ggg
)
If TG, SQLObject, and Formencode were all more dictionary oriented, much
of that tedious grunt work could be eliminated.
I have a project that I had originally written in php. Then I rewrote
it in mod_python. I am now finishing it up a rewrite to TG.
The mod_python version is smaller (and clearer) than the php version.
The TG version is smaller (and I think clearer) than the mod_python
version.
But the difference in size is not that dramatic. And when I look at my
TG code, I see a lot of lines devoted to tediously dealing with
individual attributes when I'd rather just take a dictionary, add or
modify a couple of the entries, pass it, and have it validated and
conditionally saved.
Just thought I'd mention this.
Thanks,
Steve Bergman