Problem in the code, XUFTOOLS
I made just a quick hack to the code. In setMemberProperties I changes the saved value to be a string. I am not sure if this will cause any problems, but I doubt it. I also noticed a funny thing in your code compared to the MemberData code. XUFTools puts the full mapping into the properties, while MemberDataTool only puts those properties that are really defined in the tool. In the concrete use this means that with XUFTool now even information about the request gets stored in the member properties. -huima def setMemberProperties(self, mapping): '''Sets the properties of the member. ''' #just pass the properties over to acl_users.currentPropSource memberdatatool = self.getTool() propsource = memberdatatool.acl_users.currentPropSource username = self.getUserName() for key in mapping.keys(): propsource.setUserProperty(key=key, ---->here value=str(mapping[key]), username=username) #let the parent class take care of self._members MemberData.setMemberProperties(self, mapping)
On Friday 19 April 2002 12:02 pm, Heimo Laukkanen wrote:
I made just a quick hack to the code. In setMemberProperties I changes the saved value to be a string. I am not sure if this will cause any problems, but I doubt it.
I also noticed a funny thing in your code compared to the MemberData code. XUFTools puts the full mapping into the properties, while MemberDataTool only puts those properties that are really defined in the tool. In the concrete use this means that with XUFTool now even information about the request gets stored in the member properties.
-huima
def setMemberProperties(self, mapping): '''Sets the properties of the member. ''' #just pass the properties over to acl_users.currentPropSource memberdatatool = self.getTool() propsource = memberdatatool.acl_users.currentPropSource username = self.getUserName()
for key in mapping.keys(): propsource.setUserProperty(key=key, ---->here value=str(mapping[key]), username=username)
#let the parent class take care of self._members MemberData.setMemberProperties(self, mapping)
I see what you mean about the properties mapping I think, Heimo. Does it cause a problem? Changing the value to a string is probably not a good idea if you want to store more complex data structures in a property, but for most uses it shouldn't make much difference, if any. XUF pickles everything anyway before storing it I think, or at least with the SQL propsources it does. Harry
Harry Wilkinson wrote:
I see what you mean about the properties mapping I think, Heimo. Does it cause a problem?
Changing the value to a string is probably not a good idea if you want to store more complex data structures in a property, but for most uses it shouldn't make much difference, if any. XUF pickles everything anyway before storing it I think, or at least with the SQL propsources it does.
Yep. I noticed. That bad hack was needed to correct atleast for now the unpickable errors that came, when I tried to use XUF Tools. I havenät yet studied that really further, but I believe the problem is that in XUFTools you put the whole mapping into properties -- hence causing also not pickable object to go into pickle and causing the error. So mapping it to a string is just a quick hack to help me get by until I or you can see it corrected for real. You haven't had any problems like what I just described? -huima
On Friday 19 April 2002 12:54 pm, Heimo Laukkanen wrote:
Harry Wilkinson wrote:
I see what you mean about the properties mapping I think, Heimo. Does it cause a problem?
Changing the value to a string is probably not a good idea if you want to store more complex data structures in a property, but for most uses it shouldn't make much difference, if any. XUF pickles everything anyway before storing it I think, or at least with the SQL propsources it does.
Yep. I noticed. That bad hack was needed to correct atleast for now the unpickable errors that came, when I tried to use XUF Tools. I havenät yet studied that really further, but I believe the problem is that in XUFTools you put the whole mapping into properties -- hence causing also not pickable object to go into pickle and causing the error.
So mapping it to a string is just a quick hack to help me get by until I or you can see it corrected for real. You haven't had any problems like what I just described?
-huima
No, it's worked fine for me when I've used it, but that was quite a while ago. I wrote XUFTools for one particular app I was writing that was CMF-based and needed SQL-based membership. The situation with it is pretty much "it works for me", which means I wrote it for my own benefit and thought maybe other people might have a need for the same thing. It's not maintained really, so if you have a slightly different need to me, feel free to mess with the code and make it work :) If you make any big improvements, by all means drop me an email and I'll add them ;) Harry
participants (2)
-
Harry Wilkinson -
Heimo Laukkanen