Skip to content

Instantly share code, notes, and snippets.

@l34marr
Created December 5, 2013 16:28
Show Gist options
  • Save l34marr/7808518 to your computer and use it in GitHub Desktop.
Save l34marr/7808518 to your computer and use it in GitHub Desktop.
Python Script for Archetypes Types.
from Products.CMFCore.utils import getToolByName
request = container.REQUEST
catalog = getToolByName(context, 'portal_catalog')
path = '/mysite/temples'
for brain in catalog(portal_type='Temple', path=path):
try:
obj = brain.getObject()
print brain.getPath().split('/')[5] + ', ' + brain['Title'] + ', ' + obj.getEra()
except:
pass
return printed
@l34marr
Copy link
Author

l34marr commented Dec 5, 2013

from collective.geo.geographer.interfaces import IGeoreferenced

geo = IGeoreferenced(obj)

geo.coordinates will return a tuple

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment