Re: getObjProperty in connection with Postgres

"astrid.below" <[email protected]> Tue, 19 Jan 2010 07:53:22 -0000
Newsgroups gmane.comp.cms.zms.devel
Message-ID <[email protected]>
Dear Niels,
Thanks a lot for your inspiration.
 
<!--// BO displayEvent //--> is ready now, at least, it was simple:

Create a SQL-Methode (in my case Select iditem) and choice Advanced. Activate 'Allow "simple" direct traversal'. 
record_id changing in iditim in each dtml-methods. 
Delete dtml-calls 

Now it works!

The displayCalendar need more time …

best regards
Astrid


--- In [email protected], "Niels Dettenbach" <nd@...> wrote:
>
> Dear Astrid,
> 
> afaik Zope-SQL methods are giving back dictionaries which values can't addressed by getObjectProperty() - but may be you are using the ZMS internal SQL stuff which i didn't used in much detail until today.
> 
> If you using PGSQL DB connection within your zope you may access your records by i.e.:
> <dtml in res>
>   <dtml sqlkey1>
>   <dtml-var sqlkey2>
>    ...
> </dtml-in>
> Or you can use the python-typical array conversion / syntax.
> 
> From my view you have the option to write your own "filter_list" for your SQL-data / results or to fit your SQL output into Zope / ZMS objects (i.e. as a Zope SQL method).
> 
> May be someone other have a smarter solution here - i.e. with ZMS SQL (which would interest me byself too)...
> 
> hth,
> best regards,
> 
> Niels.
> ---
> Niels Dettenbach
> http://www.syndicat.com
> 
> -- Urspr. Mitt. --
> Betreff: [zms-developers] “getObjProperty” in connection with Postgres
> Von: "Astrid Below" <astrid.below@...>
> Datum: 18.01.2010 15:25
> 
> Hallo, 
> I’m developing a Postgres-DB for our Event-Calendar and will integrate it in our ZMS.  At time we use the intern ZMS-calendar and now I try to adapt the Special-Object DTML-Methods.
> The methods doesn’t work “getObjProperty” in connection with Postgres. (The Postgres-DB I connect with
> <dtml-let res="sql_selectItems(iditem=REQUEST.get('iditem',None))">)
> 
> 
> By example:
> <dtml-in "_.range(0,_.int(getObjProperty('display_months',REQUEST)))">
> 
> In the DTML-Method
> <!--// BO displayCalendar //-->
> <dtml-call "REQUEST.set('t0',ZopeTime().timeTime())"
> ><dtml-call "REQUEST.set('ly',REQUEST.get('year',ZopeTime().year()))"
> ><dtml-call "REQUEST.set('lm',REQUEST.get('month',ZopeTime().month()))"
> ><dtml-in "_.range(0,_.int(getObjProperty('display_months',REQUEST)))"
> ><dtml-call "REQUEST.set('iy',ly)"
> ><dtml-call "REQUEST.set('im',lm+_['sequence-item'])"
> ><dtml-if "im>12"
>  ><dtml-call "REQUEST.set('iy',iy+1)"
>  ><dtml-call "REQUEST.set('im',1)"
> ></dtml-if> 
> …
> 
> Also the filter_list will not work:
> <!--// BO displayEvent //-->
> 
> <dtml-with iditem>
> <!--// BO Assemble Recordset //-->
> <dtml-call "REQUEST.set('res',getObjProperty('records',REQUEST))">
> <dtml-call "REQUEST.set('res',filter_list(res,'id',REQUEST.form['record_id']))">
> <!--// EO Assemble Recordset //-->
> 
> Is there any other terminus that I have to use?
> 
> Looking forward with best regards
> Astrid
> -- 
> Preisknaller: GMX DSL Flatrate für nur 16,99 Euro/mtl.!
> http://portal.gmx.net/de/go/dsl02
>