attributes on a file
hi, thanks for the help with my last (permissions) problem, i covered it by replacing the code with "known to work code" think it was being caused by a gettattrs call. could someone please tell me how I would modify the "file library" example to store an attribute with the file? (like the guest_name in message book) Thanks!! mike.
Michael wrote:
could someone please tell me how I would modify the "file library" example to store an attribute with the file? (like the guest_name in message book)
well, I don't have the example to hand, but my guess would be that you're looking to do something like: from AccessControl import getSecurityManager myfile.manage_addProperty('guest_name', getSecurityManager().getUser().getId() 'string') ...where myfile is your file object. That said, try just doing: myfile.getOwner(), it may do what you want already... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (2)
-
Chris Withers -
Michael