[Zope] How to make a ZPT-based form that calls itself? (Part II)
Ken Winter
ken at sunward.org
Thu May 19 10:56:44 EDT 2005
> -----Original Message-----
> From: Lennart Regebro [mailto:regebro at gmail.com]
> Sent: Thursday, May 19, 2005 4:36 AM
> To: ken at sunward.org
> Cc: J Cameron Cooper; zope at zope.org
> Subject: Re: [Zope] How to make a ZPT-based form that calls itself? (Part
> II)
>
> On 5/19/05, Ken Winter <ken at sunward.org> wrote:
> > The difference between this and the deletion example is that this form
> > (personform.htm) need to be called with an argument, giving the
> person_id
> > that identifies the record it is supposed to display. I have tried a
> number
> > of ways to sneak this argument in, but my limited experience with
> > Zope/Python syntax has left me unable to guess the right trick.
>
> Well, the generic method is to create a script that you call in the
> start of you ZPT that returns a dictionary with all the data to be
> displayed. This can also be the same script that actually does the
> deletion.
>
> http://blogs.nuxeo.com/sections/blogs/lennart_regebro/2005_04_19_python_st
> atement/
>
> May explain it a bit more, and if not, I should write something clearer.
Nor clearer - your blog is quite clear - but more elementary, for us
novices. I'm very attracted to your idea of one Python call that takes care
of returning all the data that the page needs. But I'm not sure just what
you are including in the term "data":
* I assume you include data retrieved from (and updated in) an underlying
relational database.
* Does "data" also include parameters (or arguments, or query string
variables, or whatever you call them) passed from one HTML page to the next?
This parameter-passing is what I seem to be having trouble with. How does
that script get the info it needs from the previous page? In my example,
when my "personform.htm" updates a record and then re-calls itself, how does
it get the person_id identifying the record it's supposed to display the
second time around?
I have a feeling that there's some point I'm just not getting here, but that
I'm too new to this to figure out what it is.
- Ken
More information about the Zope
mailing list