source: products/quintagroup.mobileextender/trunk/quintagroup/mobileextender/

Last change on this file was 1557, checked in by mylan, 11 years ago

Force making object with IMobile inteface only if it not yet provided

File size: 364 bytes
1from zope.interface import alsoProvides, providedBy
2from interfaces import IMobile
4def markAsMobile(object, event):
5    mobfield = object.Schema().get('mobile_content',None)
6    if mobfield and mobfield.get(object):
7        if not IMobile in providedBy(object):
8            alsoProvides(object, IMobile)
9            object.reindexObject(idxs=['object_provides'])
Note: See TracBrowser for help on using the repository browser.