Re: [Zope] Little problem with DTML
Hi, It is not clear for me why you don't use the ORDER BY clause in your SQL statement. Of course in this case you have to store month number instead of month name in your Gadfly database(to provide the right order). Cheers, Arpad -----Original Message----- From: FR Chalaoux <chalaouxf@synbio.tpgnet.net> To: zope@zope.com <zope@zope.com> Date: Thursday, February 04, 1999 8:49 PM Subject: [Zope] Little problem with DTML
Hi All,
I spend a long day trying to play with DTML and SQL method. Thus, I decided to ask to experts :) My problem is to print the result of a an SQL method "call" only if a condition is realized.
I readed many thing on documentation but even sqltest, sqlgroup, insert DTML in sql method, gave me not a solution. I admit also that these new notions are a bit new for me but more exemple should also help me.
I have a properties(monthvalue : January, February, ....) that I want to test against a value of a column of the resulting sql method (view_star_mois). If the record contents a column with the sequence-item then I print the record. This is the only solution I found to order by month my records in a gadfly database :)
========================== Document template ==========================
<!--#in monthvalue--> <!--#in view_star_month--> <!--#if "month == _vars['sequence-item']"--> <!--#var starname--> <!--#var month--> <!--#var year--> <!--#var position--> <!--#/if--> <!--#/in--> <!--#/in-->
=========================== SQL method : view_star_month =========================== select * from star
Question 1 ========== This algorithm is not very efficient cause I have to call an sql method for each sequence-item. Is there an other solution?
Question 2 ========== The previous DTML sequence creates an empty html file. Why, cause my records database contents these months?
Question 3 ========== Internationalization is not yet there for the date in Zope. Do you think with Python 1.2 this should come?
Help please, FR.
François-Régis Chalaoux Bioinformatics Group Synthélabo Biomoléculaire 67080 Strasbourg Cedex FRANCE Tél : 03 88 60 87 14 Fax : 03 88 45 90 70
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
<FontFamily><param>Courier New</param>Hi Arpad, All I also thought to this solution but in my zope application have to print the date with the month name not only with the month number (ideally). Finally I create a sql method with a 12 selects for each month but it is slow :) If I take your solution I should find a way to translate this month number in month name. I see to direction : 1/ If I can obtain the element i of the propriety list in my folder I win. But how select it, as simply in Python, this element? 2/ Create a Python class in the Zope Extension Folder with this translation capability. I try but had no succes (zope mailing list message :<color><param>0000,0000,8000</param>[Zope] - Sort date in gadfly/zope - Thu, 28 Jan 1999 17:50:57 +0100)</color> What do you thinks about? Thanks a lot, FR <color><param>0000,0000,0000</param><FontFamily><param>Arial</param>> Hi,
It is not clear for me why you don't use the ORDER BY clause in your SQL
statement.
Of course in this case you have to store month number instead of month name
in your Gadfly database(to provide the right order).
Cheers,
Arpad
François-Régis Chalaoux Bioinformatics Group Synthélabo Biomoléculaire 67080 Strasbourg Cedex FRANCE Tél : 03 88 60 87 14 Fax : 03 88 45 90 70
participants (2)
-
Arpad Kiss -
chalaouxf@synbio.tpgnet.net