Last active
August 29, 2015 13:57
-
-
Save tschanzt/9832267 to your computer and use it in GitHub Desktop.
edbs-script
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 DateTime import DateTime | |
| cat = context.portal_catalog | |
| results = cat({'query': {'path':'/www.ed.bs.ch/platform/veranstaltungskalender', 'depth':0}, 'portal_type':'FtwEvent', 'start': {'query':DateTime("2013-12-31"), 'range':'max'}}) | |
| folder = context.restrictedTraverse('/www.ed.bs.ch/platform/veranstaltungskalender') | |
| ids_to_delete = [] | |
| for item in results: | |
| if item.end and item.end.year >= 2014: | |
| continue | |
| obj=item.getObject() | |
| if not obj.frequency or obj.frequency == -1: | |
| ids_to_delete.append(obj.id) | |
| print ids_to_delete | |
| return printed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment