Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 269 by
do3cc...@gmail.com: Documentation error or bug or bits
shifted? Breaking things by using __of__
http://code.google.com/p/dexterity/issues/detail?id=269
We programatically generate dexterity objects, like explained here:
http://plone.org/products/dexterity/documentation/manual/developer-manual/reference/manipulating-content-objects
We use createObject(), then we used new_ob.__of__(container)
Then we used addContentToContainer() to add the content to the folder.
Then things got fancy, trying to access the newly created objects we got
errors because the request object did not contain a RESPONSE. The Request
itself was also weird, the __repr__ of it did not show the URL. Weirder
yet, consistently id(request) on each object jielded the same id, and when
creating the object we also had a request with the same id.
Restarting the instance, all issues vanished.
The Contenttypes themselves are the plone.app.contenttypes types, a pretty
standard File object. We could reproduce it with many different content
types.
After no success with debugging this, we went the trial and error route,
and after we stopped wrapping the object with __of__()
All objects disappeared. I am not sure if this is known behavior, then it
might make sense to add a warning in the dexterity manual, or remove the
hint of using __of__.