[Product-Developers] IObjectModifiedEvent, object modified or added?

imran.azad imran.azad at bradfordhospitals.nhs.uk
Thu Jul 28 14:15:20 UTC 2011


Hi, 

How can I workout if an object has been 'modified' or whether it's a new
object within the IObjectModifiedEvent event? The issue is that
IObjectModifiedEvent is trigged even if an object is added. I need the code
below to execute only when an object is 'modified:

@grok.subscribe(IPerson, IObjectModifiedEvent)

def rename(person, event):
    id = person.getId()
    parent = person.aq_parent
    parent.manage_renameObject(id, baseNormalize(person.title))

Thanks

--
View this message in context: http://plone.293351.n2.nabble.com/IObjectModifiedEvent-object-modified-or-added-tp6630019p6630019.html
Sent from the Product Developers mailing list archive at Nabble.com.


More information about the Product-Developers mailing list