[Zope] Re: Defining a dictionary in ZPT?

2007-11-05 Thread Josef Meile
ok, thanks Duncan ul li tal:define=query nocall:here/testquery tal:repeat=result python:query(id='IT') span tal:replace=result/lastnamelastname goes here/span /li /ul Good that you got it working. By the way, why do you need to define query? Do you really need a reference to the testquery

Re: [Zope] Re: Defining a dictionary in ZPT?

2007-11-02 Thread michael nt milne
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

Re: [Zope] Re: Defining a dictionary in ZPT?

2007-11-02 Thread michael nt milne
ok, thanks Duncan ul li tal:define=query nocall:here/testquery tal:repeat=result python:query(id='IT') span tal:replace=result/lastnamelastname goes here/span /li /ul works! I went down a blind alley with calling the database adapter due to confusion over the error message produced. Backs up my

[Zope] Re: Defining a dictionary in ZPT?

2007-11-02 Thread Duncan Booth
michael nt milne [EMAIL PROTECTED] wrote: li tal:define = query here/testquery tal:repeat=result python:query(id='IT') span tal:replace=python:repeat['result'].firstnameFirst Name/spannbsp; /li but get this as a result. Thanks for the reply. Module

Re: [Zope] Re: Defining a dictionary in ZPT?

2007-11-02 Thread michael nt milne
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

[Zope] Re: Defining a dictionary in ZPT?

2007-11-02 Thread Josef Meile
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'].firstnameFirst Name/spannbsp; /li but get this as a result. Thanks for the reply. Module

Re: [Zope] Re: Defining a dictionary in ZPT?

2007-11-02 Thread michael nt milne
Hi Josef ul li tal:define=query here/testquery tal:repeat=result python:query(id='IT') span tal:replace=repeat/resultfirstname goes here/span /li /ul gives the same AttributeError: Results instance has no __call__ method As does span tal:replace=repeat/result/firstnameFirst Name/span As

Re: [Zope] Re: Defining a dictionary in ZPT?

2007-11-02 Thread Stefan H. Holek
The only point being backed up by this thread, IMO, is that Thou shalt not code in TALES. Stefan On 2. Nov 2007, at 12:53, michael nt milne wrote: Backs up my point about more friendly and usable error messages. -- Anything that, in happening, causes something else to happen, causes

Re: [Zope] Re: Defining a dictionary in ZPT?

2007-11-02 Thread michael . milne
So use DTML? Or NKOTB? :-) On 11/2/07, Stefan H. Holek [EMAIL PROTECTED] wrote: The only point being backed up by this thread, IMO, is that Thou shalt not code in TALES. Stefan On 2. Nov 2007, at 12:53, michael nt milne wrote: Backs up my point about more friendly and usable error

[Zope] Re: Defining a dictionary in ZPT?

2007-11-01 Thread Radim Novotny
michael nt milne napsal(a): 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'].firstnameFirst Name/spannbsp; /li 1) don't make spaces around = in HTML attributes: tal:define=query

Re: [Zope] Re: Defining a dictionary in ZPT?

2007-11-01 Thread michael nt milne
1) don't make spaces around = in HTML attributes: tal:define=query here/testquery a mistake 2) Why do you use repeat['result'] ? Can you point us to documentation where did you read it ? tal:replace=result/firstname should work as expected or tal:replace=python:result[