[Zope] Two more questions

Goldthwaite, Joe invalid at bar-s.com
Tue Dec 2 21:27:42 EST 2003


Thanks again.  Still no go although it looks like it's getting closer.
I tried this;

<tr tal:replace=3D"item python:here.GetISLines(FY=3Drequest.FY,
Per=3Drequest.Per)">

To my programmer eyes, that looks like it might be correct. I got a
really strange error though;

Error Type: TypeError
Error Value: unsupported operand type(s) for -

Does this mean that I have an unsupported operand for the nothing after
the dash or is it for the dash? There's no dash in the statement so I
guess I have an unsupported operand for nothing :~{


P.S. Tim, sorry for sending this message twice.  When I reply it goes
directly to the source instead of the list and I forget to type the
zope at zope.org before I send it.


-----Original Message-----
From: Tim Zegir [mailto:trzegir at ncable.net.au]
Sent: Tuesday, December 02, 2003 6:48 PM
To: joe at goldthwaites.com
Subject: RE: [Zope] Two more questions


Hi Joe,

I had another look and realized I was doing the wrong thing ;)
Try this instead.
<tr tal:repeat=3D"python:here.GetISLines(FY=3Drequest.FY;Per=3Drequest)">

From
Tim Zegir
-----Original Message-----
From: zope-bounces at zope.org [mailto:zope-bounces at zope.org] On Behalf Of
Goldthwaite, Joe
Sent: Wednesday, 3 December 2003 12:23 PM
To: zope at zope.org
Subject: RE: [Zope] Two more questions

Thanks Tim,

It didn't work.  I get a SyntaxError on the question mark. Specifically;

Compilation failed
TAL.TALDefs.TALError: Python expression error:
    GetISLines?FY=3Drequest
              ^
SyntaxError: invalid syntax in expression
'python:GetISLines?FY=3Drequest', at
line 10, column 5

This brings up more questions.  I assume that GetISLines is looked up
through acquisition.  FY is the name of one of my parameters.  How does
it
know that I want the FY attribute of the request object?  Also, how
would I
pass two parameters?  "GetISLines?FY=3Drequest;Per=3Drequest"?

-----Original Message-----
From: Tim Zegir [mailto:trzegir at ncable.net.au]
Sent: Tuesday, December 02, 2003 5:46 PM
To: joe at goldthwaites.com
Subject: RE: [Zope] Two more questions


Sorry about the last email :)
In answer to the second question
Try something like this:
<tr tal:repeat=3D"item python:GetISLines?FY=3Drequest">

>From Tim Zegir

-----Original Message-----
From: zope-bounces+trzegir=3Dncable.net.au at zope.org
[mailto:zope-bounces+trzegir=3Dncable.net.au at zope.org] On Behalf Of
Goldthwaite, Joe
Sent: Wednesday, 3 December 2003 11:36 AM
To: zope at zope.org
Subject: [Zope] Two more questions

I really hate to keep bothering everyone but I'm still running into
things I
don't understand.

In order to keep my table headers consistent across reports, I have them
stored as a separate DTML method called IS_Ptd_Header.  In my main
Income
Statement, I have this where I want the table header to show up;

<span tal:replace=3D"structure here/IS_Ptd_Header"></span>

This works fine.  The problem I've run into is when I want to use tal
tags
in the header like this;

Income Statement for period <span
tal:replace=3D"request/Per">Period</span>

If I have this line in the Income Statement, I get the Per parameter
from
the URL. The same line in IS_Ptd_Header gets ignored so the resulting
page
shows "Income Statement for period period".  I thought that maybe the
tal
tags were being ignored because IS_Ptd_Header is a DTML method so I
created
a ZPT with the name IS_YTD_Header and used that in the tal replace
command
but the result came back as HTML quoted text instead of the actual HTML.
Anyone know what I'm missing?


Second problem.  I have an external method called GetISLines.  The
actual
function being called looks like this;

def GetISLines(FY =3D 2, Per =3D 12, CatType =3D "Grp", Categories =3D ""=
):
   c =3D ISLines(FY, Per, CatType, Categories)
   return c.DefLines

I've been doing all my testing using the default arguments with this tal
tag;

<tr tal:repeat=3D"item here/GetISLines">

I need to pass in the URL parameters but I can't figure out how to do
it.

<tr tal:repeat=3D"item here/GetISLines(request.FY)"> doesn't work.
Nothing
else I've tried works either.  How do you pass parameters to an external
function?


Thanks.

Joe Goldthwaite


_______________________________________________
Zope maillist  -  Zope at 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 )




_______________________________________________
Zope maillist  -  Zope at zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -=20
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )




Property of Bar-S Foods. This message is intended only for the use of the=
 Addressee and may contain information that is PRIVILEGED and CONFIDENTIA=
L.  If you are not the intended recipient, dissemination of this communic=
ation is prohibited.  If you have received this communication in error, p=
lease erase all copies of the message and its attachments and notify us i=
mmediately at 602.264.7272 or postmaster at bar-s.com.




More information about the Zope mailing list