source: products/qPloneGoogleMaps/tags/0.1.0/adapters/markers.py @ 1591

Last change on this file since 1591 was 1, checked in by myroslav, 18 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 793 bytes
Line 
1from zope.interface import implements
2from Products.qPloneGoogleMaps.interfaces.markers import IMarkersListing
3
4class MarkersListing(object):
5    """ simple markers adapter that prepare markers listing for view
6    """
7    implements(IMarkersListing)
8   
9    def __init__(self, context):
10        """ init  """
11        self.context = context
12   
13    def listMarkers(self):
14        """ return markers listing """
15        if self.context.portal_type == "Topic":
16            contentsMethod = self.context.queryCatalog
17        elif self.context.portal_type in ["Folder", "Large Plone Folder"]:
18            contentsMethod = self.context.getFolderContents
19        else:
20             return None
21        markers = [marker for marker in contentsMethod() if marker.geoLocation]
22        return markers
Note: See TracBrowser for help on using the repository browser.