[Zope] Howto debug (Re: PostgreSQL Problem)

Steve Spicklemire steve@spvi.com
Wed, 21 Mar 2001 07:35:35 -0500 (EST)


Hi (again) Andreas,

you might also try just:

<dtml-var MenuItem>

I don't remember if ZSQL will strip off the tablename or not. I do know
that due to the fact that result objects use a dictionary to hold
results you can't have two tables with fields of the same
name, but you can use 'AS' to fix that.

select a.count AS a_count, b.count AS b_count from .... 

to give 'count' a distinct name in the result object.. 

good luck!
-steve

>>>>> "SJS" == Steve Spicklemire <steve@spvi.com> writes:

    SJS> Hi Andreas,

    SJS> Hmm... have you tried:

    SJS> <dtml-var i.MenuItem>

    SJS> which is what shows up in your select statement?

    SJS> the upper/lower caseness of these things also matters.

    SJS> -steve

>>>>> "Andreas" == Andreas Tille <tillea@rki.de> writes:

    Andreas> Hello,

    Andreas> I really wonder how to do debugging in Zope.  I tried
    Andreas> several things regarding to the available documentation
    Andreas> and because I've got no answer over this list I think
    Andreas> there is no problem in the code I posted (see below).

    Andreas> Are there any methods to track down the problem?  I know
    Andreas> that many people use PostgreSQL with Zope but I wonder
    Andreas> how they got their very first example working :-(.

    Andreas> Kind regards

    Andreas> Andreas.

    Andreas> On Tue, 13 Mar 2001, Andreas Tille wrote:

    >>> Hello,
    >>> 
    >>> I'm using Zope 2.2.2 and zope-pygresqlda 0.3rjr2.  I have
    >>> created the following ZSQL method (here displayed in the
    >>> "Test"-View):
    >>> 
    >>> Z SQL Method at /Control_Panel/Products/Ifsg/GetMainMenu
    >>> 
    >>> Idmenushow Idwebseite Menuitem 54 25 Description 57 110
    >>> Components 61 71 Objectives 52 20 Links 51 57 About us
    >>> 
    >>> 
    >>> SQL used:
    >>> 
    >>> SELECT i.IdMenuShow, i.IdWebSeite, i.MenuItem FROM Menu m
    >>> INNER JOIN MenuItem i ON i.IdMenu = m.IdMenu WHERE m.IdMenu =
    >>> 52 ORDER BY i.Sort ;
    >>> 
    >>> 
    >>> I try to use the output of this Query in the following
    >>> DTML-document:
    >>> 
    >>> DTML Document at /Control_Panel/Products/Ifsg/Databasetest
    >>> 
    >>> 
    >>> <dtml-var standard_html_header>
    >>> 
    >>> 
    >>> <dtml-in GetMainMenu> <dtml-var Menuitem><br> </dtml-in>
    >>> <dtml-var standard_html_footer>
    >>> 
    >>> 
    >>> If I try to "View" Databasetest I get:
    >>> 
    >>> Zope Error
    >>> 
    >>> Zope has encountered an error while publishing this resource.
    >>> 
    >>> Error Type: KeyError Error Value: Menuitem
    >>> 
    >>> Could anybody enlighten me, what's the problem here?
    >>> 
    >>> Kind regards
    >>> 
    >>> Andreas.


    Andreas> _______________________________________________ Zope
    Andreas> maillist - Zope@zope.org
    Andreas> http://lists.zope.org/mailman/listinfo/zope ** No cross
    Andreas> posts or HTML encoding!  ** (Related lists -
    Andreas> http://lists.zope.org/mailman/listinfo/zope-announce
    Andreas> http://lists.zope.org/mailman/listinfo/zope-dev )