Last change
on this file since 1557 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 | |
---|
1 | from zope.interface import alsoProvides, providedBy |
---|
2 | from interfaces import IMobile |
---|
3 | |
---|
4 | def 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.