I have a field in my MySQL database which is allowed to be null and has a value of NULL as default. I am retrieving this field and numerous others using a call to dtml-in. After the retrieval, I would like to determine what this value is inside my DTML document/method. What is the equivalent of NULL in Zope? Is it a value of 'None'? I am using the following code but it doesn't work. <dtml-if expr="undergraduate_projects_directed == 'None'"> <dtml-call "REQUEST.set('undergraduateProjectsDirected', 'Hello')"> </dtml-if> Any help would be greatly appreciated. Thanks. - Asad
From: "Asad Habib" <ahabib@engin.umich.edu>
I have a field in my MySQL database which is allowed to be null and has a value of NULL as default. I am retrieving this field and numerous others using a call to dtml-in. After the retrieval, I would like to determine what this value is inside my DTML document/method. What is the equivalent of NULL in Zope? Is it a value of 'None'?
I am using the following code but it doesn't work.
<dtml-if expr="undergraduate_projects_directed == 'None'"> <dtml-call "REQUEST.set('undergraduateProjectsDirected', 'Hello')"> </dtml-if>
Try: <dtml-if expr="undergraduate_projects_directed == '''"> note: that's two single quotes back-to-back, followed by a double quote to close the expression Jonathan
Hi To test in python that a field from MySQL is null test for a None value. Like this: <dtml-if expr="undergraduate_projects_directed == None"> <dtml-call "REQUEST.set('undergraduateProjectsDirected', 'Hello')"> </dtml-if> without quotes Dragos ----- Original Message ----- From: "Asad Habib" <ahabib@engin.umich.edu> To: <zope@zope.org> Sent: Friday, February 27, 2004 3:55 PM Subject: [Zope] Detecting a NULL Value
I have a field in my MySQL database which is allowed to be null and has a value of NULL as default. I am retrieving this field and numerous others using a call to dtml-in. After the retrieval, I would like to determine what this value is inside my DTML document/method. What is the equivalent of NULL in Zope? Is it a value of 'None'?
I am using the following code but it doesn't work.
<dtml-if expr="undergraduate_projects_directed == 'None'"> <dtml-call "REQUEST.set('undergraduateProjectsDirected', 'Hello')"> </dtml-if>
Any help would be greatly appreciated. Thanks.
- Asad
_______________________________________________ Zope maillist - Zope@zope.org 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 )
On Fri, 2004-02-27 at 14:55, Asad Habib wrote:
I have a field in my MySQL database which is allowed to be null and has a value of NULL as default. I am retrieving this field and numerous others using a call to dtml-in. After the retrieval, I would like to determine what this value is inside my DTML document/method. What is the equivalent of NULL in Zope? Is it a value of 'None'?
I am using the following code but it doesn't work.
<dtml-if expr="undergraduate_projects_directed == 'None'"> <dtml-call "REQUEST.set('undergraduateProjectsDirected', 'Hello')"> </dtml-if>
I use PostgreSQL and Oracle. For each of them, I generally do this : <dtml-unless undergraduate_projects_directed> ... </dtml-unless> Thierry
Asad Habib wrote at 2004-2-27 08:55 -0500:
I have a field in my MySQL database which is allowed to be null and has a value of NULL as default. I am retrieving this field and numerous others using a call to dtml-in. After the retrieval, I would like to determine what this value is inside my DTML document/method. What is the equivalent of NULL in Zope? Is it a value of 'None'?
I am using the following code but it doesn't work.
<dtml-if expr="undergraduate_projects_directed == 'None'">
Try: "..._directed is None". -- Dieter
participants (5)
-
Asad Habib -
Dieter Maurer -
Dragos Chirila -
FLORAC Thierry -
Small Business Services