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
Hi Michael, Michael Geddert wrote:
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.
What's your aim here? If it's simply to be able to authenticate with your MySQL users, it's much simpler than that! Just implement getUserDetails as a Z SQL Method as described in the README.TXT...
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.
Well, as a work around, I'd just replace the above with a call to a ZSQLMethod: here/getUserEmail ...and have that Z SQL Method select the required data direct from the MySQL Database...
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.
Start analysing what's happening... Put some pritn statements in your code and watch the Zope server console...
Could someone point me to the right direction plz ? This is starting to get me frustrated
What I'd like to see is getUserDetails return a user that has more properties than just the basic auth details. What are people's requirements for this beyond Michael's example? For myself, I worked around a similar issue in a different way, btu I'm interested in other people's solutions :-) cheers, Chris
participants (2)
-
Chris Withers -
Michael Geddert