[Zope] Python product consisting of few python classes

Petr Knapek petr.knapek@nextra.cz
24 Sep 2001 18:13:11 +0200


Hi Zopists,

I have problem with my python product for Zope 2.4.1. I have a product
which consists of few my own python classes - source codes are put in
product folder. Some of these classes need to be publishable via
ZPublisher and this is problem. In one of them the DTMLFiles are bad
mapped at dtml files (I do not know where it is overriden). Does anybody
know, how to write correct code for python products into Zope which
consists of a lot of python classes where some of them have to be
publishable?


PermissionDalmatin.py : - this is publishable class

import Globals
from Globals import DTMLFile
from Acquisition import Implicit
from AccessControl.Role import RoleManager

class PermissionDalmatin(Implicit, RoleManager):

   manage_permissionsISNGForm =3D DTMLFile('perm/permissions', globals(=
))

   def getRoleOfPerm(self, perm=3D'View'):


Globals.InitializeClass(PermissionDalmatin)



DalmatinProduct.py : -this is my python product implementation

import time, DateTime, string, urllib
import Globals
from Globals import DTMLFile, MessageDialog
from OFS.Folder import Folder                   #Zope Folder object
#from Products.PermissionManager.PermissionDalmatin import PermissionDa=
lmatin
from AccessControl import ClassSecurityInfo
from Dalmatin import Dalmatin  # Dalmatin's interface
from Products.Dalmatin.GUI import GUIContainer # default GUI of contain=
er object
from Products.Dalmatin.BaseObject import BaseObject # base functionalit=
y of all Dalmatin's objects
from Products.Dalmatin import Core # Dalmatin's core library
from Products.Dalmatin.PermissionDalmatin import PermissionDalmatin

class DalmatinProduct(Folder, PermissionDalmatin, GUIContainer,
BaseObject):

   manage_editISNGForm =3D DTMLFile('dtml/edit', globals())

   def manage_edit(self, title, key_words, REQUEST=3DNone):

Globals.InitializeClass(Dalmatin)



And when I call manage_permissionsISNGForm of DalmatinProduct instance
this error is raised:

2001-09-24T16:15:40 PROBLEM(100) ZPublisher DTML file
'/usr/home/knapek/apps/Zope-2.4.1-src/lib/python/Products/Dalmatin/dtml=
/permissions.dtml'
could not be read

But permissions.dtml is well located in 'DalmatinProduct'/perm/ as you
can see above. DalmatinProduct instance tries to find it in
'DalmatinProduct'/dtml/ where DTMLFiles for DalmatinProduct class are
located. Please, help me, I can't see bug.



Thanks, Petr=20
--=20
Petr Kn=E1pek
Network Development
NEXTRA Czech Republic s.r.o. http://www.nextra.cz/
V Celnici 10 / CZ - 117 21 Praha 1 / Czech Republic
Tel: +420/2/96 355 111 / Mobile: +420/604-202 611
E-Mail: petr.knapek@nextra.com

Contact address:
Hlinky 114 / CZ - 603 00 Brno / Czech Republic
Tel: +420/5/43 554 150 / FAX: +420/5/43 554 214
see Disclaimer http://www.nextra.cz/disclaimer/