----- Original Message ----- From: "Garito" <[EMAIL PROTECTED]>
I try again:

I have a property on the property manager called member1 with a value of "[/some/path]"

User1 ask for this property. We calculate the real value for /some/path for these user: 1 User2 ask for this property. We calculate the real value for /some/path for these user: 2

I have a property on the property manager called member2 with a value of "[a reference to the calculator]"

A user ask for this property from his firefox. We calculate the real value for the reference for this browser: <result1> Another user ask for this property from his ie. We calculate the real value for the reference for this browser: <result2>

I would like to change the "accessor" for any property in my Zope product

How can I?


If I understand what you are trying to accomplish (of which I am not completely sure)...then you could create a script that accesses the object and returns a value based on the user agent string:

eg.

import string
REQUEST = container.REQUEST

targetObject = context.restrictedTraverse('/some/path/objId')

if string.find(REQUEST['HTTP_USER_AGENT'], 'Firefox') != -1:
  <do something with targetObject.attribute for Firefox users)
elif string.find(REQUEST['HTTP_USER_AGENT'], 'MSIE') != -1:
  <do something with targetObject.attribute for Internet Explorer users)
else:
  <do something with targetObject.attribute for xxx users)

Note: 'attribute' is whatever property you have defined for the object.

hth

Jonathan
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to