- Timestamp:
- 10 Dec 2010, 09:28:18 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_epayment/purgeDefinedPayments.py
r5609 r5610 26 26 import DateTime 27 27 logger = logging.getLogger('Skins.purgeDefinedPayments') 28 from Products.AdvancedQuery import Eq, Between, Le,In 28 from Products.AdvancedQuery import Eq, Between, Le,In,MatchGlob,MatchRegexp 29 29 aq_payments = context.payments_catalog.evalAdvancedQuery 30 30 31 31 commit_after = 100 32 32 counter = 0 33 counter_all = 0 33 34 34 #payments = context.payments_catalog(resp_desc = 'Invalid Card Number') 35 query = Eq('resp_desc','Invalid Card Number') 36 payments = aq_payments(query) 35 payments = context.payments_catalog(status = 'failed') 36 #query = In('resp_desc','Invalid*',) 37 #payments = aq_payments(query) 38 39 logger.info("started, %d failed payments found" % len(payments)) 37 40 38 41 for payment in payments: 39 to_del = [] 42 counter_all += 1 43 if not 'Cumulative total of payment' in payment.resp_desc: 44 continue 40 45 payments_folder = getattr(getattr(students_folder,payment.student_id),'payments',None) 41 42 46 counter += 1 43 47 pid = 'p' + payment.order_id[6:] 44 48 if getattr(payments_folder,pid,False): 45 logger.info('object deleted: %s , %s, %s ' % (payment.student_id, pid, payment.resp_desc))49 logger.info('object deleted: %s , %s, %s, %d of %d' % (payment.student_id, pid, payment.resp_desc, counter, counter_all)) 46 50 else: 47 51 logger.info('no object: %s, %s' % (payment.student_id, pid))
Note: See TracChangeset for help on using the changeset viewer.