[Zope] Regarding Mysql Query

Peter Bengtsson mail@peterbe.com
Tue, 7 Aug 2001 12:42:10 +0200


You have two problems.
We don't know which one you've solved.

Do one thing at a time:

<dtml-in test.py>
 <dtml-in DbQuery1 size=10 start=query_start>
     <dtml-var sequence-item>
 </dtml-in>
</dtml-in>

If that works, your Z SQL methods problem are solved.

Nextly, copy one of the printed sequence items and try (Independently):

<dtml-var "_.getitem('one of the names')">


Does that help.

Besides, it think there's a difference in
<dtml-let names="_.getitem('sequence-item')">
and
<dtml-let names="_.getitem(_['sequence-item'])">

Both will "work" but it depends on what you want to do.

Cheers, Peter

----- Original Message -----
From: "sudhakar" <sudhakar@mindscapecomputing.com>
To: <zope@zope.org>
Sent: Tuesday, August 07, 2001 6:40 AM
Subject: [Zope] Regarding Mysql Query


>
> hi guys,
>
> i am very new to zope .
> i executed a query that will print 25 column. i don't want to hardcode the
> column name.i am getting the column name by below python script
>
>   test.py
>   rec = context.DbQuery1()
>   print "names: ", rec.names(), "\n"
>   return rec.names()
>
> using the column name i want to print the corresponding data.
>
> <dtml-in test.py>
> <dtml-in DbQuery1 size=10 start=query_start>
> <dtml-let names="_.getitem('sequence-item')">
> <dtml-var names>
> </dtml-let>
> </dtml-in>
> </dtml-in>
>
> but it's printing the object.
>
> <r instance at 02FF5E50>
> <r instance at 02FF5730>
> <r instance at 02FF5200>
> <r instance at 02FF59A0>
> <r instance at 02FF54F0>
> <r instance at 02FF5B60>
> <r instance at 02FF5180>
> <r instance at 02FF64A0>
> <r instance at 02FF68B0>
> <r instance at 02FF6500>
>
>
> can any one help me .
>
> regards,
> S.Sudhakar
> Sys Admin, Progammer
> Mindscape Computing (P) Ltd.,
> Bangalore
>
>
>
>
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )