<FontFamily><param>Courier</param><bigger>Hi All,


FR Chalaoux wrote :


As you know a gadfly database has no 
date type for the moment.

Thus, as Aaron Watters recommanded, 
sort date is possible if you 

construct a date string with the 
format 'YY:MM:DD'(without quote).


Paul Everitt wrote :


Is it possible to construct this 
string date on the fly in an SQL 

method or is it an other solution?


Yes, use the object-relational 
integration described at:



<underline><color><param>0000,8000,0000</param>http://www.zope.org/Documentation/Guide
s/ZSQL/ZSQL-HTML/ZSQL.html#pgfId-

</underline></color>936577


Basically, just write a Python class 
with a method that does what you

want.


=======================================

That's my resulting work :


I did it on the Page 19 model from 
ZSQL.pdf file but it does not 

work :(



=======================================

New External Method

=======================================

<<HTML>

<<HEAD>

<<TITLE>New External Method<</TITLE>

        <<base 
href="http://srnoix:9673/DBTest/">

<</HEAD>

<<BODY BGCOLOR="#FFFFFF" LINK="#000099" 

VLINK="#555555" ALINK="#77003B">


<<h2>New External Method<</h2>


<<FORM 
ACTION="manage_addExternalMethod" 

METHOD="POST">

<<TABLE CELLSPACING="2">

<<TR>

  <<TH ALIGN="LEFT" VALIGN="TOP">Id<</TH>

  <<TH ALIGN="LEFT" VALIGN="TOP"><<INPUT 
TYPE="TEXT" 

NAME="id" SIZE="50" 
value="datastring"><</TH>

<</TR>

<<TR>

  <<TH ALIGN="LEFT" 
VALIGN="TOP"><<EM>Title<</EM><</TH>

  <<TD ALIGN="LEFT" VALIGN="TOP"><<INPUT 
TYPE="TEXT" 

NAME="title" SIZE="50" value="Gadfly 
date"><</TD>

<</TR>

<<tr>    <<th ALIGN="LEFT">Function 
name<</th>

        <<td ALIGN="LEFT"><<input 
name="function" size="30" 

value="datastring"><</td><</tr>

<<tr>    <<th ALIGN="LEFT">Python module 
file<</th>

        <<td ALIGN="LEFT"><<input 
name="module" size="30" 

value="datastring"><</td><</tr>

<<TR>

<<TD><</TD>

<<TD><<BR><<INPUT TYPE="SUBMIT" 
VALUE="Add"><</TD>

<</TR>

<</TABLE>

<</FORM>

<</BODY>

<</HTML>


=======================================

Extension/datastring.py

=======================================

class datastring:

	

def datastring(self)

"""Create a new string composed with 
data from my gadfly table

"""

return year + ':' + month + ':' + day



=======================================

Error

=======================================

<<html>

<<head>

<<title>exceptions.AttributeError<</title
>

<</head>

<<body>

Sorry, an error occurred.<<p>

<<!--

Traceback (innermost last):

  File /opt/digicool/zope/Zope-1.9.0-

src/lib/python/ZPublisher/Publish.py, 
line 879, in publish_module

  File /opt/digicool/zope/Zope-1.9.0-

src/lib/python/ZPublisher/Publish.py, 
line 595, in publish

    (Info: 
/DBTest/manage_addExternalMethod)

  File /opt/digicool/zope/Zope-1.9.0-

src/lib/python/Products/ExternalMethod/
ExternalMethod.py, line 

137, in manage_addExternalMethod

    (Object: Navigation)

  File /opt/digicool/zope/Zope-1.9.0-

src/lib/python/Products/ExternalMethod/
ExternalMethod.py, line 

179, in __init__

    (Object: Item)

  File /opt/digicool/zope/Zope-1.9.0-

src/lib/python/Products/ExternalMethod/
ExternalMethod.py, line 

198, in manage_edit

    (Object: Item)

  File /opt/digicool/zope/Zope-1.9.0-

src/lib/python/Products/ExternalMethod/
ExternalMethod.py, line 

215, in getFunction

    (Object: Item)

AttributeError: func_defaults


-->

<</body>

<</html>






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

