So doing some more routing around on the lists I saw this advice > FWIW you > might want to call the query or execute methods directly on the DA > connection object if they are supported.
Therefore my db connection object is ado_db_connection. Modifying my code to the below and calling the query method of the adapter now gives me an 'insufficient priviledges' in my Plone site...Nearly there I feel. Strange as I am logged in as the uberuser... <ul> <li tal:define="query here/testquery" tal:repeat="result python: context.ado_db_connection().query(id='IT')"> <span tal:replace="repeat/result/firsname">firstname goes here</span> </li> </ul> On 11/2/07, michael nt milne <[EMAIL PROTECTED]> wrote: > > ps for completeness > > here is the testquery ZSQL which works fine when tested in the ZMI and > manually inputting the id variable. > > select * from tblEmployees where department = (<dtml-sqlvar id > type="string">) order by 'location' > > I have 'id' in the argument field > > Thanks > > On 11/2/07, michael nt milne <[EMAIL PROTECTED] > wrote: > > > > Hi Josef > > > > > > > > <ul> > > <li tal:define="query here/testquery" tal:repeat="result > > python:query(id='IT')"> > > <span tal:replace="repeat/result">firstname goes here</span> > > </li> > > </ul> > > > > gives the same > > > > > AttributeError: Results instance has no __call__ method > > > > As does > > > > <span tal:replace="repeat/result/firstname">First Name</span> > > > > As does > > > > <span tal:replace="result/firstname">First Name</span> > > > > ! > > > > Thanks for your help. Not easy this ZPT!, even when you have read the > > documentation :-) > > > > On 11/2/07, Josef Meile <[EMAIL PROTECTED] > wrote: > > > > > > Hi Michael > > > > > > michael nt milne schrieb: > > > > yeah I have modified to this > > > > > > > > <li tal:define = "query here/testquery" > > > > tal:repeat="result python:query(id='IT')"> > > > > <span tal:replace="python:repeat['result'].firstname">First > > > > Name</span> > > > > </li> > > > > > > > > but get this as a result. Thanks for the reply. > > > > > > > > Module Products.PTProfiler.ProfilerPatch, line 32, in > > > __patched_call__ > > > > Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__ > > > > - __traceback_info__: query(id='IT') > > > > Module Python expression "query(id='IT')", line 1, in <expression> > > > > AttributeError: Results instance has no __call__ method > > > I suspect that result isn't a dictionary. Why don't you try to print > > > result instead and see its type? Try this: > > > > > > <span tal:replace="repeat/result"></span> > > > > > > You could also try the other sintax for your zpt: > > > <span tal:replace="repeat/result/firstname">First Name</span> > > > > > > Regards > > > Josef > > > _______________________________________________ > > > Zope maillist - [email protected] > > > http://mail.zope.org/mailman/listinfo/zope > > > ** No cross posts or HTML encoding! ** > > > (Related lists - > > > http://mail.zope.org/mailman/listinfo/zope-announce > > > http://mail.zope.org/mailman/listinfo/zope-dev ) > > > > > > > > > > > -- > > michael > > > > > -- > michael -- michael
_______________________________________________ Zope maillist - [email protected] http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
