source: WAeUP_SRP/trunk/skins/waeup_utilities/ti_64fc_resolve.py @ 5060

Last change on this file since 5060 was 3046, checked in by Henrik Bettermann, 17 years ago

file renamed

File size: 1.3 KB
Line 
1## Script (Python) "ti_64fc_resolve"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=
9##
10# $Id: ti_64fc_resolve.py 3045 2008-01-25 09:14:17Z joachim $
11"""
12"""
13try:
14    from Products.zdb import set_trace
15except:
16    def set_trace():
17        pass
18
19mtool = context.portal_membership
20member = mtool.getAuthenticatedMember()
21if str(member) not in ('admin','joachim'):
22    return
23
24
25import logging
26import DateTime
27logger = logging.getLogger('Skins.ti_64fc_resolve')
28from Products.AdvancedQuery import Eq, Between, Le,In
29#aq_portal = context.portal_catalog_real.evalAdvancedQuery
30accommodation = context.portal_accommodation
31aq_accommodation = accommodation.evalAdvancedQuery
32#students_folder = context.portal_url.getPortalObject().campus.students
33
34request = context.REQUEST
35session = request.SESSION
36response = request.RESPONSE
37setheader = request.RESPONSE.setHeader
38def rwrite(s):
39    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
40    response.write("%s<br>\n\r" % s)
41
42beds = aq_accommodation(Eq('student',''))
43bed_list = [bed.bed for bed in beds]
44logger.info("found %d with empty student" % len(bed_list))
45d = {}
46d['student'] = accommodation.not_occupied
47for bed in bed_list:
48    d['bed'] = bed
49    accommodation.modifyRecord(**d)
50    logger.info("modified %s " % bed)
51
Note: See TracBrowser for help on using the repository browser.