source: WAeUP_SRP/base/skins/waeup_pins/archive_delete.py @ 3076

Last change on this file since 3076 was 3076, checked in by joachim, 17 years ago

add archive and archive_delete, show all batches in pins_view

  • Property svn:keywords set to Id
File size: 802 bytes
Line 
1## Script (Python) "archive_delete"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=ids=[], REQUEST=None
8##title=
9##
10# $Id: archive_delete.py 3076 2008-01-31 18:29:58Z joachim $
11"""
12archive and delte PIN batches
13"""
14
15import logging
16logger = logging.getLogger('Skins.archive_delete')
17member_id = str(context.portal_membership.getAuthenticatedMember())
18
19if ids:
20    for id in ids:
21        ob = getattr(context, id)
22        ob['archiveBatch'](delete=True)
23    message = 'portal_status_message=%s archived and deleted' % ' '.join(ids)
24    context.manage_delObjects(ids)
25else:
26    message = 'portal_status_message=select at least one batch to archive and delete'
27
28if REQUEST is not None:
29    return REQUEST.RESPONSE.redirect("%s?%s" % (context.absolute_url(), message))
30   
Note: See TracBrowser for help on using the repository browser.