You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i would like to see an update method, that really acts like updating (eg changing) using the mechanism used during a browser session.
inspiration:
i do have a package where i registered a custom method on the ObjectModifiedEvent.
during tests i create a structure of folders and pages using
plone.api.content.create(container, type, title, a_costum_field_from_my_behavior)
the method gets triggered -> container modified. so far, so good.
now i want to change the value of a_costum_field_from_my_behavior.
try 1:
self.portal.my-content-object.a_costum_field_from_my_behavior = new_value
-> no event triggered, not even after transaction.commit()
try 2:
z3c.form; get the field; update the value
-> no event triggered
try 3:
test browser; not what i wanted, as its not browser test, just a simple functional test. but itried at least -> no event triggered
thanks to @jensens i did it via zope.event.notify.
having to know was really hard work to get there and cost me several hours... i wouldn't even know how to search that (searching without knowing what to search is always hard)
thats why i would love to see an update method
plone.api.content.update(object, fields={field:value, field:value, ...})
which does the complete set of mechanisms done by plone in normal usage.
The text was updated successfully, but these errors were encountered:
i would like to see an update method, that really acts like updating (eg changing) using the mechanism used during a browser session.
inspiration:
i do have a package where i registered a custom method on the ObjectModifiedEvent.
during tests i create a structure of folders and pages using
plone.api.content.create(container, type, title, a_costum_field_from_my_behavior)
the method gets triggered -> container modified. so far, so good.
now i want to change the value of a_costum_field_from_my_behavior.
try 1:
self.portal.my-content-object.a_costum_field_from_my_behavior = new_value
-> no event triggered, not even after transaction.commit()
try 2:
z3c.form; get the field; update the value
-> no event triggered
try 3:
test browser; not what i wanted, as its not browser test, just a simple functional test. but itried at least -> no event triggered
thanks to @jensens i did it via zope.event.notify.
having to know was really hard work to get there and cost me several hours... i wouldn't even know how to search that (searching without knowing what to search is always hard)
thats why i would love to see an update method
plone.api.content.update(object, fields={field:value, field:value, ...})
which does the complete set of mechanisms done by plone in normal usage.
The text was updated successfully, but these errors were encountered: