[Zope-PAS] Properties Plugin
Christian Klinger
cklinger at novareto.de
Tue Mar 20 07:27:57 EDT 2007
Hello,
i try to add Properties to all of my PAS-Users.
The Properties should be the adresse information
of my Users, which i get about an WebService.
Now i have developed a very simple example of a
IPropertiesPlugin:
security.declarePrivate('getPropertiesForUser')
def getPropertiesForUser(self, user, request=None):
""" Fullfill PropertiesPlugin requirements """
### Cache Implementation
view_name = createViewName('retrievePropsData', user)
keywords = {'key' : user}
properties = self.ZCacheable_get( view_name = view_name,
keywords = keywords,
default = None )
if properties is None:
properties = {}
properties['addr'] = "SampleData"
tt=self.ZCacheable_set( properties ,
view_name=view_name,
keywords=keywords )
return properties
Now i have some questions about it:
Shoud I use (and why) the UserPropertySheet instead of a simple dict?
Is the cache implementation ok?
Does anyone have a simple example for this task?
thx Christian
More information about the Zope-PAS
mailing list