Created
December 5, 2013 16:28
-
-
Save l34marr/7808518 to your computer and use it in GitHub Desktop.
Python Script for Archetypes Types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from collective.geo.geographer.interfaces import IGeoreferenced
geo = IGeoreferenced(obj)
geo.coordinates will return a tuple