That is why I want to use the schema more and ask for more dict related
functionalities in FormEncode, SQLObject, TG. Coding in this style just
makes no sense to me. It looks cool for a quick 20 minutes wiki demo
but breaks down when I have lots of fields and lots of tables.

Steve Bergman wrote:
> 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

Reply via email to