On Mar 11, 2006, at 3:14 AM, Thierry FLORAC wrote:

On Thu, 2006-03-09 at 01:14 -0700, Shane Hathaway wrote:
Your idea of annotating InternalPrincipals rather than Principals seems
to work, but I apparently did something wrong, because edited
annotations don't persist!  I can save edits, but when I reload the
page, they're gone.  I don't know why.

As said in a previous (and un-replied :-( !) post a few days ago, I have the same kind of problem with an adapter using annotations : if I set my
attributes using a "property" attribute, the setter is not called and
modifications are lost when page is reloaded ; I have to call the setter directly (after modifying the interface, of course) from my adapter for
modifications to be stored...

I haven't had time to read much or reply, so these may not be what you and Shane are talking about, but I just saw this...

- yes, don't annotate principals. principal objects are not persistent, and like the Zope 2 PAS are created and discarded within a request. annotating internal principals is not recommended either: it won't work with other plugin designs. Use principal annotations. Make sure that the adapter providing IAnnotations for principals returns the principal annotations. (I thought I had done this for Zope 3, but maybe I just did it for some internal work...)

- Thierry, send me a link to your email and I'll try to look at it (especially if it is short :-) ). It could be that you are not using a persistent-aware data structure (PersistentDict or a BTree). We successfully do the sort of thing you seem to be describing, so I suspect some disconnect.

Zope3-users mailing list

Reply via email to