[Zope] basic python class & zope question

Tudor Gabriel tdrgabi at gmail.com
Tue Jun 12 19:53:49 EDT 2007


hi im new here , first post ... and new to zope.

i've read the manual ... and zope framework looks very promising ...
i started writing a couple of templates ... and run into some basic problems
like:

Problem 1.
is it posible to have a python class ... defined in a script .... like
class learn:
   def print_something(self):
      print 'it works'


and call it from zpt ... like <span
tal:replace="learn/print_something">replace</span>?

or how can i call a method from this object ? ... i tryied with python:
learn.print_something() and many different ways and i still don't get it.

i'm starting to suspect that i can use classes only as zope products ...
and call from zpt ... only scripts without classes.

also do i have to set the properties/attributes of the script which contains
the class ... with the methods?

because by calling learn/print_somthing i get an AttributeError ... url
might be invalid etc...

Problem 2.

how can i call/return from an python script a html file which resides in
some folder above the script.

i wanna call abc/index.html ... from abc/def/script.py

i tryied with the container['index.html'[ but it doesn't return anything.

thank you for the patience and sorry for the very basic questions ... but i
feel that if i understand this things ... i can really get started with
zope.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20070613/42b35b8f/attachment.htm


More information about the Zope mailing list