Changeset 365
- Timestamp:
- 07/04/06 07:40:46
- Files:
-
- geolocation/trunk/Extentions (added)
- geolocation/trunk/Extentions/Install.py (added)
- geolocation/trunk/Extentions/__init__.py (added)
- geolocation/trunk/adapter.py (modified) (3 diffs)
- geolocation/trunk/browser/location.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
geolocation/trunk/adapter.py
r364 r365 3 3 from zope.app.annotation.interfaces import IAnnotations, IAnnotatable 4 4 from Products.CMFPlone.CatalogTool import registerIndexableAttribute 5 from persistent.mapping import PersistentMapping 5 6 6 7 GEOLOCATION_KEY = "geolocation.adapter" … … 39 40 def setLocation(self, longitude, latitude): 40 41 """ set location """ 41 self.geolocation['longitude'] = value42 self.geolocation['latitude'] = value42 self.geolocation['longitude'] = longitude 43 self.geolocation['latitude'] = latitude 43 44 44 45 default = None 45 46 46 47 def geoLocation(obj, portal, **kw): 47 """ long idx"""48 """ return the location list """ 48 49 adapter = IGEOLocated(obj, None) 49 50 if adapter: 50 51 return (adapter.getLongitude(), adapter.getLatitude()) 51 52 return default 52 53 """ 53 54 def Longitude(obj, portal, **kw): 54 """ long idx """55 55 adapter = IGEOLocated(obj, None) 56 56 if adapter: … … 59 59 60 60 def Latitude(obj, portal, **kw): 61 """ lat idx """62 61 adapter = IGEOLocated(obj, None) 63 62 if adapter: 64 63 return adapter.getLatitude() 65 64 return default 66 67 registerIndexableAttribute('Longitude', Longitude) 68 registerIndexableAttribute('Latitude', Latitude) 65 """ 66 registerIndexableAttribute('geoLocation', geoLocation) 67 #registerIndexableAttribute('Longitude', Longitude) 68 #registerIndexableAttribute('Latitude', Latitude) geolocation/trunk/browser/location.py
r364 r365 7 7 # Product imports 8 8 from Products.geolocation.interface import IGEOLocated, IGEOLocatedView 9 from zLOG import LOG10 import sys, traceback11 from StringIO import StringIO12 9 13 10 class GEOLocatedView(BrowserView):
