[Zope] ZDataQueryKit Thank You!

Derek Basch dbasch@yahoo.com
Wed, 7 Aug 2002 13:32:03 -0700 (PDT)


Jeff,
Good Idea. I will post the issue resolution for
posterity. Here goes, its a long one :)
------------------------------------------------------
> Hello,

Hi there.. I'm not on the Zope list, but someone
forwarded this for me.

I am the author of ZDataQueryKit, let see if we can
sort out what is 
going
wrong here.

> I posted the below question before but no one
> answered. So I guess I
> will now ask, does anyone have anyone have any
> experience with
> ZDataQueryKit? Can anyone give me a rundown of how
to
> use the Z
> Report Tool? It looks like a great tool but I cant
get
> it to work
> (see below).
> Thanks for the help,
> Derek Basch
>
> Hello,
> I am trying to learn how to use ZDataQueryKit w/
> Firebird/Interbase and I keep getting a KeyError. I

Hmm... never used Interbase, but if it has a
straightforward Zope DA 
then it
should work ok.

> create a simple ZSQLMethod such as "SELECT * FROM
> T_CONTACTS" and name it "testmethod". I then create
a

What do you get on the test page of the ZSQLMethod?

> Z Report Tool with the id and title of "report" and
a
> Data Source of "testmethod". I press Add and Edit
and
> I get:
>
> Zope has encountered an error while publishing this
> resource.
>
> Error Type: KeyError
> Error Value: PK_CON_ID

Hmmm... can you send me the complete column list for
the table 
(Including
data types if possible?) (Just a thought)

> I thought it might have something to do with the
> primary key column but I tried just selecting a non
> key column and it still fails. Rather than mucking
> around in code for hours, I thought I would ask if
> anyone has an idea what im doing wrong?
> Thanks in adavance,
> Derek T Basch
>

If you look in the HTML source of the error page, you
will find a 
Python
traceback, could you send at least this to me please
(The source for 
the
whole page would probably be even better.)

Finally, what versions of Zope, Python and
ZDataQueryKit are you using?

Adrian...
------------------------------------------------------
Adrian,
Thank you for the reply! I am a twit sometimes. I
should have emailed you first instead of cluttering up
the zope list. I added a bug request to your plone
site before I got your email so please disregard it :)
Here goes....

###Components

1) kinterbasDB DA v 1.3 2002/04/29
#It seems to be a "normal" DA as far as I know. I have
only ever used this DA. I need to practice some ODBC
DA stuff soon. ZSQLMethods functions test ok. I have
been having fun with stored procedures and
ZSQLMethods.

2) Zope Version  (Zope 2.5.1 (binary release, python
2.1, win32-x86))
 
3) Python Version  2.1.3 (#35, Apr 8 2002, 17:47:50)
[MSC 32 bit (Intel)]

4) ZDataQueryKit 1.1.0

###Traceback page source
http://www.geocities.com/dbasch/report.htm

#It looks to my newbie eye that it cant lay out the
Document Template. I didnt even know that the
tracebacks were in the source! So many things to learn
in Zope! 

####Database Metadata in Interbase Data Definition
Langauge
http://www.geocities.com/dbasch/contacts.txt

Well, I think that is everything you asked for. Thanks
again for helping a newbie,
Derek Basch
------------------------------------------------------
Heh, I love the collector!!!

I'll try to install interbase here, but I think I can
see what has 
happened
and I thought I had already fixed it. I'll look in CVS
and see when I 
made
the correction, or if this is a new bug.

Hmm... I have just tried this with the most recent
version against 
MySQL and
there is no apparent problem.

1) Try re-creating the report object
2) Try creating a report object against a very simple
query (select
CON_FNAME, CON_LNAME from T_CONTACTS) and see what
happens.
3) Try downloading
http://cvs.haqa.co.uk/viewcvs/Products/ZDataQueryKit/ZDataQueryKit.tar.gz?ta
rball=1 which is the latest version and re-create the
report object 
(Again,
sorry)

If this still fails I have to see if I can get an
Interbase installed 
and
running here, but the licensing is kind of unusual,
and I don't want to 
find
I am in breach....

Adrian...
------------------------------------------------------
Woot! It works! (pause for happy dance). Looks like
you fixed it with the latest CVS. I can now play with
making the reports look nice with CSS. It looks like
you were nice enough to automatically assign CSS
classes of 'data' and 'heading' to the table cells.
This should make layout alot easier. Time to learn how
to use ZStyleSheets!
I am trying to understand this sentance from 'Column
Options':
   'If you select just Total you get a grand total, if
you select both Group and Total you get sub-totals as
well.'
I dont see anywhere to select 'Total'? I do see a
'Group' under 'Display/Formula'. What is the
'Subtotals Class' for?

I also need to figure out how to make these tables
printable. Any suggestions?
Sorry for all the silly questions :). 
Thanks again,
Derek Basch
------------------------------------------------------
> Woot! It works! (pause for happy dance). Looks like

Woot????

> you fixed it with the latest CVS. I can now play
with
> making the reports look nice with CSS. It looks like
> you were nice enough to automatically assign CSS
> classes of 'data' and 'heading' to the table cells.
> This should make layout alot easier. Time to learn
how
> to use ZStyleSheets!

Heheh... I'll tell, you, almost like I planned it that
way :) :)

> I am trying to understand this sentance from 'Column
> Options':
>    'If you select just Total you get a grand total,
if
> you select both Group and Total you get sub-totals
as
> well.'
> I dont see anywhere to select 'Total'? I do see a

Hmm.. ok... lets take that sentance... throw it in the
bin, and replace 
it
with this one:-

"The 'Display' options (Not available for calculated
columns) allow you 
to
choose how columns should be displayed (or hidden) and
sub/grand 
-totalled.

Grouping implies sorting (ascending). Grouping with
summary hidden will
display the group headline, but no sub/grand totals."

> 'Group' under 'Display/Formula'. What is the
> 'Subtotals Class' for?

The CSS class for the group head/tail lines

> I also need to figure out how to make these tables
> printable. Any suggestions?

Ah, now that is easy. In your standard_html_header put
a test like 
this:

<html><..................><body>
<dtml-if "REQUEST.has_key('printable')">
All your page headings side-bars etc...
</dtml-if>

Then in standard_html_footer

<dtml-if "REQUEST.has_key('printable')">
All your page headings side-bars etc...
</dtml-if>

> Sorry for all the silly questions :).
> Thanks again,
> Derek Basch

No problem :)

Adrian...
------------------------------------------------------

--- Jeff Sacksteder <jwsacksteder@ramprecision.com>
wrote:
> You're welcome.
> 
> Why don't you post the resolution of your issue to
> the list, so that it will
> be archived and searchable for anyone else who might
> have that problem in
> the future?


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com