source: products/quintagroup.mobileextender/trunk/quintagroup/mobileextender/handlers.py @ 1561

Last change on this file since 1561 was 1557, checked in by mylan, 14 years ago

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

File size: 364 bytes
Line 
1from zope.interface import alsoProvides, providedBy
2from interfaces import IMobile
3
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.