Merge lp:~cjwatson/lazr.lifecycle/zope.lifecycleevent-4.2.0-compat into lp:lazr.lifecycle

Proposed by Colin Watson
Status: Merged
Merged at revision: 37
Proposed branch: lp:~cjwatson/lazr.lifecycle/zope.lifecycleevent-4.2.0-compat
Merge into: lp:lazr.lifecycle
Diff against target: 27 lines (+9/-0)
2 files modified
src/lazr/lifecycle/NEWS.txt (+2/-0)
src/lazr/lifecycle/event.py (+7/-0)
To merge this branch: bzr merge lp:~cjwatson/lazr.lifecycle/zope.lifecycleevent-4.2.0-compat
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
LAZR Developers Pending
Review via email: mp+373724@code.launchpad.net

Commit message

Add ObjectModifiedEvent.descriptions property.

Description of the change

This fixes tests with zope.lifecycleevent >= 4.2.0.

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/lazr/lifecycle/NEWS.txt'
2--- src/lazr/lifecycle/NEWS.txt 2019-08-21 12:10:12 +0000
3+++ src/lazr/lifecycle/NEWS.txt 2019-10-07 09:12:42 +0000
4@@ -6,6 +6,8 @@
5 ===
6
7 - Import IObjectEvent from zope.interface rather than zope.component.
8+- Add ObjectModifiedEvent.descriptions property, for compatibility with
9+ zope.lifecycleevent >= 4.2.0.
10
11 1.1 (2009-12-03)
12 ================
13
14=== modified file 'src/lazr/lifecycle/event.py'
15--- src/lazr/lifecycle/event.py 2009-03-24 16:17:11 +0000
16+++ src/lazr/lifecycle/event.py 2019-10-07 09:12:42 +0000
17@@ -85,3 +85,10 @@
18 super(ObjectModifiedEvent, self).__init__(object, user=user)
19 self.object_before_modification = object_before_modification
20 self.edited_fields = edited_fields
21+
22+ # Compatibility with zope.lifecycleevent. (Note that the returned
23+ # modification descriptions only implement `IModificationDescription` if
24+ # suitable objects were passed when constructing this event.)
25+ @property
26+ def descriptions(self):
27+ return self.edited_fields

Subscribers

People subscribed via source and target branches