Re: [Zope-dev] PythonMethods: Can't Slice context.REQUEST.PARENTS

2000-11-14 Thread Dieter Maurer

The Doctor What writes:
  Using context.this().id, self.this().id, m_self.this().id all get me
  the same things:
  Folder, Zope, and my method.  None give me the DTML Document
  foo_html.
If it is indeed a DTML Document, then "this()" should reference
this document. If it is a DTML Method, then "this()" will
reference the methods 'client', usually the methods parent.

  
  Did you mean to do a this().id?  That doesn't work at all, it gives
  me a Name Error.
No.
I am not yet familiar with PythonMethods and what binding
they define automatically. Obviously, you have
"context", "m_self" and "self".
My older PythonMethods installed seem to support only "self",
but I am not sure.

I would expect, that "context.this()" has the highest chance
of success, maybe "self.this()".

Note, that "foo_html" must be a DTML Document not a DTML Method!


  There *must* be a way to do this.
There is none for DTML Methods (other than modifying the code).


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] PythonMethods: Can't Slice context.REQUEST.PARENTS

2000-11-14 Thread The Doctor What

I got a reply from someone working on it.  It seems the answer is
that it doesn't exist yet, pending a change in ZOPE itself.

So I have to pass it in:
dtml-var expr="breadcrumbs(this())"

Not a big deal, but annoying.

I'll make the source available as soon as I coble together a
view-source method. :)

Ciao!

-- 
"Well, given that the universe is infinite, and that God is infinite, and that God 
created the universe, (pause) would you like a piece of toast?"
--Talkie Toaster (Red Dwarf episode: Dimension Jump)

The Doctor What: A Holtje Production http://docwhat.gerf.org/
[EMAIL PROTECTED]   KF6VNC

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] PythonMethods: Can't Slice context.REQUEST.PARENTS

2000-11-14 Thread Dieter Maurer

Evan Simpson writes:
  From: The Doctor What [EMAIL PROTECTED]
   Using context.this().id, self.this().id, m_self.this().id
  all get me
   the same things:
   Folder, Zope, and my method.  None give me the DTML
  Document
   foo_html.
  
   This would seem to be an important thing.
  
  The only information about your caller that you can get is
  the contents of their namespace.  So, in the final release,
  you would be able to bind the caller's namespace to "_" and
  write _.this().id.  That requires a change to Zope, though,
  so it doesn't work yet.  You *could* work around this by
  explicitly passing the namespace (or this(), for that
  matter).
Why can't I get the acquisition context as with External Methods?
(if they are called directly via the Web, namespaces are not
yet build and the acquisition context obtained via a "self"
parameter is everything I have).


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] PythonMethods: Can't Slice context.REQUEST.PARENTS

2000-11-13 Thread Evan Simpson

From: The Doctor What [EMAIL PROTECTED]
 Using context.this().id, self.this().id, m_self.this().id
all get me
 the same things:
 Folder, Zope, and my method.  None give me the DTML
Document
 foo_html.

 This would seem to be an important thing.

The only information about your caller that you can get is
the contents of their namespace.  So, in the final release,
you would be able to bind the caller's namespace to "_" and
write _.this().id.  That requires a change to Zope, though,
so it doesn't work yet.  You *could* work around this by
explicitly passing the namespace (or this(), for that
matter).

Cheers,

Evan @ digicool  4-am


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] PythonMethods: Can't Slice context.REQUEST.PARENTS

2000-11-12 Thread Dieter Maurer

The Doctor What writes:
  ...
  Now here is my next problem.
  
  Using context.REQUEST.PARENTS doesn't give me the DTML Document that
  called me (so to speak).
  
  I have:
  /test/new/foo_html
  
  My PARENTS shows Zope, Test, and New, but doesn't show foo_html.
"PARENTS" contain the objects from root up to but excluding
the final object on the URL.

You may try to reference the final object by "this()".


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] PythonMethods: Can't Slice context.REQUEST.PARENTS

2000-11-12 Thread The Doctor What

* Dieter Maurer ([EMAIL PROTECTED]) [001112 17:12]:
 The Doctor What writes:
   ...
   Now here is my next problem.
   
   Using context.REQUEST.PARENTS doesn't give me the DTML Document that
   called me (so to speak).
   
   I have:
   /test/new/foo_html
   
   My PARENTS shows Zope, Test, and New, but doesn't show foo_html.
 "PARENTS" contain the objects from root up to but excluding
 the final object on the URL.
 
 You may try to reference the final object by "this()".

Dieter, thanks for your help, but I'm unsure where to use it.

Using context.this().id, self.this().id, m_self.this().id all get me
the same things:
Folder, Zope, and my method.  None give me the DTML Document
foo_html.

This would seem to be an important thing.

To re-iterate in a different way, it's the same as trying to do:
dtml-var id in a DTML Method that is called by a DTML Document.
You expect the id of the DTML Document that called you, not the
Folder that the DTML Document resides in.

Did you mean to do a this().id?  That doesn't work at all, it gives
me a Name Error.

There *must* be a way to do this.

Ciao!

-- 
It has just been discovered that research causes cancer in rats.

The Doctor What: A Holtje Production http://docwhat.gerf.org/
[EMAIL PROTECTED]   KF6VNC

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] PythonMethods: Can't Slice context.REQUEST.PARENTS

2000-11-11 Thread The Doctor What

Okay, I figured that bit of braindeadness out (I just use a range
that goes backwards, no .reverse() so everything is left as is.

Now here is my next problem.

Using context.REQUEST.PARENTS doesn't give me the DTML Document that
called me (so to speak).

I have:
/test/new/foo_html

My PARENTS shows Zope, Test, and New, but doesn't show foo_html.

Is this because my PythonMethod is Internal vs. External?  I didn't
see any descriptions of what the differences are.

The DTML Method version of my code can see the id/title of the
foo_html via 'id', 'title' and 'title_or_id', but under python I
just get:
self.title_or_id() -- Zope, the folder that my method lives at
m_self.title_or_id() -- Breadcrumbs (my method)
context.title_or_id() -- New, the folder foo_html lives at

And I have no idea what _ is for

Any help is appreciated.

Ciao!

-- 
"Well Pumpkins, It looks like it comes down to that age old decision: Style or 
Substance.  Hmm."
--Vida and the "Girls" ( To Wong Foo, Thanks for everything, Julie 
Newmar )

The Doctor What: "What, Doctor What" http://docwhat.gerf.org/
[EMAIL PROTECTED]   KF6VNC

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )