[Zope] SimpleUserFolder Advice
Michael Geddert
geddert@arche.de
Thu, 24 Jul 2003 16:27:00 +0200
Hi List,
I'm using SUF 0.9.0 on Zope2.6.1. I have to map the methods
getProperty/setProperty of
SUF's User-Object to ZSQL-Methods because we're using existing table
structures
from exUserFolders MySQLPropSource.
Basically, I need to do a "user.getProperty('email')" (e.g. in a ZPT) to
get a string with the current users email adress. This is working great.
My Problem occurs when I want to get another Userobject from the
Userfolder:
uo=context.acl_users.getUser('anton')
uo.getProperty('email')
.. makes my Zope spin forever, my Browser keeps loading and loading,
but nothing ever
happens.
Here's a snippet of what I added to User.py:
def getProperty(self,key):
parent=getattr(self,"aq_parent",None)
context=getattr(parent,"aq_parent",None)
# Check here later for context
# Get Property from DB via ZSQL
result=context.get_my_prop(myprop=key,myusername=self.name)
return result[0][0]
get_my_prop is a ZSQL Method and it works fine.
I suspect "context" to break away within User.py at some point, maybe
because the Object is not "wrapped" in Acquisition which would mean the
ZSQL-Methods never get triggered
(not sure exactly, somebody enlighten me plz).
I also tried to let the Userfolder return User[dict].__of__(self) at
some point, but that did not do the job either.
Could someone point me to the right direction plz ?
This is starting to get me frustrated
Cheers,
Michael