Changeset 1668


Ignore:
Timestamp:
2 Apr 2007, 10:17:36 (18 years ago)
Author:
joachim
Message:

show all new students with review_state >= cleared_and_validated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/list_students.py

    r1312 r1668  
    1212export student_list
    1313"""
     14try:
     15    from Products.zdb import set_trace
     16except:
     17    def set_trace():
     18        pass
     19from Products.AdvancedQuery import Eq, Between, Le,In,MatchRegexp
     20aq_portal = context.portal_catalog.evalAdvancedQuery
     21aq_students = context.students_catalog.evalAdvancedQuery
    1422request = context.REQUEST
    1523setheader = request.RESPONSE.setHeader
     
    3341lines.append(','.join(fields))
    3442format = '"%(' + ')s","%('.join(fields) + ')s"'
    35 cleared = context.portal_catalog(review_state = "cleared_and_validated")
     43#cleared = context.portal_catalog(review_state = "cleared_and_validated")
     44query = In('review_state',('cleared_and_validated',
     45                           'school_fee_paid',
     46                           'courses_registered',
     47                           'courses_validated'))
     48cleared = aq_portal(query)
     49newquery = Eq('portal_type','StudentApplication') & MatchRegexp('SearchableText',r'^6*')
     50#newquery = MatchRegexp('SearchableText','^5*')
     51new_students = aq_portal(newquery)
     52new_sids = []
     53for ns in new_students:
     54    new_sids.append(ns.getPath().split('/')[-2])
    3655for student in cleared:
     56    if student.getId not in new_sids:
     57        continue
    3758    erg = scat(id=student.getId)
    3859    if not erg:
Note: See TracChangeset for help on using the changeset viewer.