[Zope] Newbie question

David Lambert dave_lambert@fbcc.com
Fri, 3 Aug 2001 14:45:24 -0500


Chris,
	Thanks, that works fine. Now can you guide me to the appropriate 
documentation for finding the names of objects such as ZopeTime. I had been 
trying to access these methods by using DateTime which I guess is the Python 
equivalent? Maybe I'm still a little confused.

TA
Dave.

On Friday 03 August 2001 08:37, Chris McDonough wrote:
> When you call something from DTML, the "namespace" is searched for the
> name you're trying to access (in your cases, getSize and dow).  The
> rules for this namespace search are byzantine, and even I don't know
> them.  The intent, however, is for you to *not* have to know them
> (though this fails miserably sometimes).
>
> While getSize is an attribute of most Zope objects (and can usually be
> acquired as well), it's generally found easily in the namespace.
> However, IIRC, 'dow' is a method of ZopeTime objects, so youd either
> need to put "dow" into the namespace explicitly:
>
> <dtml-with "ZopeTime()">
>   <dtml-var dow>
> </dtml-with>
>
> Or call it directly on an instance:
>
> <dtml-var "ZopeTime().dow()">
>
> HTH,
>
> - C
>
> David Lambert wrote:
> > I am currently browsing the API Reference section of the Zope book and am
> > trying simple examples. I am puzzled as to how various methods may be
> > accessed from dtml. For instance the line:
> >
> > <dtml-var expr="getSize()"> works fine, but:
> >
> > <dtml-var expr="dow()"> (which I would have expected to return the day of
> > week) gives an error
> >
> > Obviously I am confused. Could somebody try and put me on the right
> > tracks!
> >
> > TIA
> >
> > Dave.
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > 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 )