[Zope] problem with dtml-var displaying None for NULL from postgres

Chris Kratz chris.kratz@vistashare.com
Wed, 6 Jun 2001 10:47:45 -0400


Hello Troy,

Thanks for the help.  <dtml-var variable missing> or <dtml-var variable
missing=""> don't work.  But, <dtml-var variable null> does work and that is
what we are doing now instead of wrapping the <dtml-var> with a <dtml-if>.
Though better, this solution still requires visiting every page and field.
Anybody out there have any better ideas?

-Chris

----- Original Message -----
From: "Farrell, Troy" <troy.farrell@wcg.com>
To: "'Chris Kratz'" <chris.kratz@vistashare.com>
Cc: <zope@zope.org>
Sent: Tuesday, June 05, 2001 6:29 PM
Subject: RE: [Zope] problem with dtml-var displaying None for NULL from
postgres


> Chances are (I haven't verified this yet) that PoPy and ZPoPyDA don't set
> the variable if it isn't there in PostgreSQL. Try:
>
> <dtml-var variable missing>
>
> Troy
>
> -----Original Message-----
> From: Chris Kratz [mailto:chris.kratz@vistashare.com]
> Sent: Tuesday, June 05, 2001 4:05 PM
> To: zope@zope.org
> Subject: [Zope] problem with dtml-var displaying None for NULL from
> postgres
>
>
> Hello all,
>
> Up until this week, we were running Zope on a windows ME box against an
> access database using ODBC for our first stage of development.  Now, I
have
> migrated the database and the zope instance over to a Linux box running
Red
> Hat 7.1, Zope 2.3.2, Python 1.5.2, PostgreSQL 7.1, with the PoPy
> 2.0.1/ZPoPyDA 1.2 connecting everything up and we are running
successfully.
>
> My question is this: we have quite a large number of pages where we use
the
> <dtml-var> tag to dump a field from the database (after a select).  On the
> previous setup, when the field was NULL in the database, the var tag
happily
> did nothing.  Now, on the new server, if a Null is found, it prints out
None
> instead of nothing.  For now, I am manually modifying the pages and
wrapping
> each of the var tags with an if tag like this: <dtmil-if field><dtml-var
> field></dtml-if> which gives the expected behavior.  This works, but is
time
> consuming.
>
> I have examined each of the pieces (Zope/ZPoPyDA/PoPy/PostgreSQL) and
cannot
> find an easy way to change this behavior.  After reading some related
> information on the mailing list, I think the culprit is most likely the
DA.
> Unfortunately, I was not successfull in installing the psycopg DA and the
> current version of egenics mxDateTime so I cannot compare the two DA's
> (ZPoPyDA and psycopgDA).
>
> Is this expected behavior?  Is the Zope 2.3.2, Python 1.5.2, ZODBCDA,
> MSAccess configuration simply different in some aspect?  Why are we
getting
> different behaviors with everything the same except a different database?
> If there is no way around this, is there a faster/better way to modify the
> pages so that they don't display anything for a NULL field?
>
> Thanks for your help,
>
> -Chris
>
>
> _______________________________________________
> 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 )