----- Original Message -----
From: Dieter Maurer <[EMAIL PROTECTED]>
To: Tim Hicks <[EMAIL PROTECTED]>
Sent: Friday, January 12, 2001 10:28 PM
Subject: Re: [Zope] document_src not doing what I thought it did


> Tim Hicks writes:
>  > I have a dtml-documentish zclass and have created a custom edit method
for
>  > it so that I can do an automatic reindex when each instance is edited.
I
>  > created this custom form by simply copying the source html that is
generated
>  > for the standard edit form, and then replacing the static parts of what
I
>  > copied with various <dtml-var > inserts (see below).  This seemed to go
>  > according to plan until I realised that something strange is happening
when
>  > I try to view this edit form for an instance of the zclass.  In most
cases,
>  > everything seems normal, but when I try to edit an instance that has a
>  > property set to 'private', my 'privacy' method kicks in and redirects
me
>  > away from the edit form to my standard 'Restricted Page'.  The
redirection
>  > is written into the text of the instance I am trying to edit, so I
expected
>  > that by using <dtml-var document_src>, the actual source would get
placed in
>  > the text area without being processed.  This is what appears to happen
when
>  > the instance does not have the 'private' property.  I guess therefore,
my
>  > question is, am I using document_src correctly?
> Is is possible that your edit form is called
> in the context of you ZInstance?
>

I'm not sure I completely understand the terminology you use, but I guess it
sounds right that the edit form method is called 'on' (in my terminology
;-) ) the Zclass instance.  It is in that way that the <dtml-var
id/title/get_size/etc> retrieve the attributes of the instance and not the
method itself... is that correct? Is that what you mean?

> Then, it might be able that *it* interpretes the "private"
> and redirects before "document_src" is executed at all.

Each Zclass instance has <dtml-call privacy><dtml-if "available* ==
1"><dtml-call RESPONSE.redirect(restricted)><dtml-else>blah</dtml-if> . (*
set by the privacy method).  Thanks for your help with that btw :-).
However, the edit form method does not have this code in it.  As far as I
can gather, the only time the method gets to 'see' the code shown above is
when it inserts <dtml-var document_src>.

What am I missing?

tim


>
>
> Dieter
>


_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
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 )

Reply via email to