Unexpiring content
Filed Under:
Others got SQL. We've got the catalog.
Here's a quick snippet for quickly un-expiring content from a ./bin/instance debug session:
plone_site = app.foo
from transaction import commit
import DateTime
now = DateTime.now()
for brain in plone_site.portal_catalog({
'expires' : {'query' : now, 'range' : 'max'}}):
obj = brain.getObject()
obj.setExpirationDate(now + 30)
obj.reindexObject()
commit()
This sets the expiration date of all currently expired objects 30 days into the future. (You'll need to change app.foo to the id of your plone instance, of course.)
