RE: [Zope] Re: Lost in name Space...

2001-01-26 Thread James Sintz

You can also do the following:

dtml-var "RandomGretting.Greet(_.None, _)"

Jamey

 -Original Message-
 From: Prateep Siamwalla [SMTP:[EMAIL PROTECTED]]
 Sent: Friday, January 26, 2001 6:20 AM
 To:   [EMAIL PROTECTED]
 Subject:      [Zope] Re: Lost in name Space...
 
 Ok, found the answer:
 
 dtml-with RandomGreeting
 dtml-var Greet
 /dtml-with
 
 
 - Original Message - 
 From: Prateep Siamwalla [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, January 26, 2001 5:55 PM
 Subject: Lost in name Space...
 
 
  Sorry if you happen to see this for the third time, I have been trying
  to post this on egroups, but have failed on several occasions.
  
  Hi,
  Zope newbie here, a bit lost on namespaces...
  
  I have created a folder in the zope root called "RandomGreeting".  
  Inside this folder, there is one DTML METHOD called "Greet".  "Greet" 
  contains the following line:
  
  pdtml-var expr="_.whrandom.choice(sayHellos)"/p
  
  "sayHellos" is a property of the "RandomGreeting" folder, and 
  contains 4 lines which are various ways to say 
  hello : "Ola","Hi","Bonjour","Sawasdi".  The purpose of this method
  is to print out a random greeting.
  
  Everytime i click "View" for this DTML Method, i get a random hello.  
  Fine, that is exactly what I want.
  
  The problem is that I am trying to use this "method" from its parent 
  folder (the root folder as a matter of fact).  I have inserted the 
  following bit into the top level "index_html" DTML Method of my Zope 
  root near the begining, so that it produces a random hello on the 
  front page everytime someone accesses it.
  
  I have tried :
  dtml-var RandomGreeting.Greet
  dtml-var RandomGreeting.Greet()
  dtml-var "RandomGreeting.Greet()"
  dtml-var /RandomGreeting/Greet
  
  all of these, to know avail.  I am getting either a NameError or 
  KeyError.  I am pretty sure I'm missing a simple concept here. It is 
  possible to call functions from child objects is it not? 
  
  Please help with some enlightenment.  Many thanks in advance.
  
  teep
  
  
  
  
  
  
  
 
 
 ___
 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 )

___
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 )




Re: [Zope] Re: Lost in name Space...

2001-01-26 Thread Prateep Siamwalla

James,
Thanks for the help.  Unfortunately your suggestion did not work, i got
a NameError on "sayHellos" (which is a property of the RandomGreeting
folder.)

I managed to get it to work by two other ways.

dtml-with RandomGreeting
dtml-var Greet
/dtml-with

and

dtml-var "RandomGreeting.Greet(RandomGreeting)"

I'm just beginning to understand the first way, however, I'm still
scratching
my head about how the second way works...

thanks again for the help,

teep

- Original Message -
From: James Sintz [EMAIL PROTECTED]
To: 'Prateep Siamwalla' [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, January 26, 2001 10:27 PM
Subject: RE: [Zope] Re: Lost in name Space...


 You can also do the following:

 dtml-var "RandomGreeting.Greet(_.None, _)"

 Jamey

  -Original Message-
  From: Prateep Siamwalla [SMTP:[EMAIL PROTECTED]]
  Sent: Friday, January 26, 2001 6:20 AM
  To: [EMAIL PROTECTED]
  Subject: [Zope] Re: Lost in name Space...
 
  Ok, found the answer:
 
  dtml-with RandomGreeting
  dtml-var Greet
  /dtml-with
 
 
  - Original Message -
  From: Prateep Siamwalla [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Friday, January 26, 2001 5:55 PM
  Subject: Lost in name Space...
 
 
   Sorry if you happen to see this for the third time, I have been
trying
   to post this on egroups, but have failed on several occasions.
  
   Hi,
   Zope newbie here, a bit lost on namespaces...
  
   I have created a folder in the zope root called "RandomGreeting".
   Inside this folder, there is one DTML METHOD called "Greet".  "Greet"
   contains the following line:
  
   pdtml-var expr="_.whrandom.choice(sayHellos)"/p
  
   "sayHellos" is a property of the "RandomGreeting" folder, and
   contains 4 lines which are various ways to say
   hello : "Ola","Hi","Bonjour","Sawasdi".  The purpose of this method
   is to print out a random greeting.
  
   Everytime i click "View" for this DTML Method, i get a random hello.
   Fine, that is exactly what I want.
  
   The problem is that I am trying to use this "method" from its parent
   folder (the root folder as a matter of fact).  I have inserted the
   following bit into the top level "index_html" DTML Method of my Zope
   root near the begining, so that it produces a random hello on the
   front page everytime someone accesses it.
  
   I have tried :
   dtml-var RandomGreeting.Greet
   dtml-var RandomGreeting.Greet()
   dtml-var "RandomGreeting.Greet()"
   dtml-var /RandomGreeting/Greet
  
   all of these, to know avail.  I am getting either a NameError or
   KeyError.  I am pretty sure I'm missing a simple concept here. It is
   possible to call functions from child objects is it not?
  
   Please help with some enlightenment.  Many thanks in advance.
  
   teep



___
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 )