[ZPatterns] mystery with restrictedTraverse

Joachim Schmitz [email protected]
Sat, 8 Sep 2001 12:06:36 +0200 (CEST)


Hi,

I found a strange problem when calling a restrictedTraverse in a Specialist,
which is contained in Specialist.

Here is my Setup:

I am accessing the ZopeServer with ZPatterns over xmlrpc, I am using the
ZSyncer-Product as xmlrpc-servercomponent, to access the data stored in a
Specialists.

The client Python-script looks like this:

def test_aixtra_get(): #{{{
    server_url="http://xxx.zzz.de/Syncer/"
    path=""
    t = BasicAuthTransport(username="jjjj",password="oooo")
    server=xmlrpclib.Server(server_url,t,verbose=1)

    try:
        R = server.getPersistentItem("AixAd/Rechnung/Positionen", '0901031')
        #R = server.getPersistentItem("AixAd/Rechnung", '090103')
        #R = server.getPersistentItem("AixAd/Kunden", '1123')
    except xmlrpclib.Fault,e:
        for l in split(str(e),'\\n'):
            print  l
    print R

#}}}

the funktion in the server is:

def getPersistentItem(self,path,itemId):
    ''' Get the a Dataskins persistent data '''
    object = self.restrictedTraverse(path)
    return object.getId()

for

    R = server.getPersistentItem("AixAd/Rechnung", '090103')

AixAd is a normal Folder, Rechnung is a specialist.
this returns:

Rechnung

for

    R = server.getPersistentItem("AixAd/Rechnung/Positionen", '090103')

AixAd is a normal Folder, Rechnung is a specialist, Positionen is a specialist.

this returns:

  <H2>Site Error</H2>

  <P>An error was encountered while publishing this resource.
  </P>

  <P>
  <STRONG>Error Type: NameError</STRONG><BR>
  <STRONG>Error Value: global name \'has\' is not defined</STRONG><BR>
  </P>

The most strange thing is that worked with 2.4.1b1, after installing 2.4.1
final it failed.

I just tested it with 2.3.3 there it works too.
With a normal folder in a subfolder it works too.

Any hint is apreacheated.




Mit freundlichen Grüßen

Joachim Schmitz

AixtraWare, Ing. Büro für Internetanwendungen
Hüsgenstr. 33a, D-52457 Aldenhoven
Telefon: +49-2464-8851, FAX: +49-2464-905163