Changeset 3084


Ignore:
Timestamp:
1 Feb 2008, 12:15:11 (17 years ago)
Author:
joachim
Message:

use portal_catalog instead of students_catalog to find levels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_utilities/ti_71fc_resolve.py

    r3082 r3084  
    2828from Products.AdvancedQuery import Eq, Between, Le,In
    2929aq_students = context.students_catalog.evalAdvancedQuery
     30aq_portal = context.portal_catalog_real.evalAdvancedQuery
    3031students_folder = context.portal_url.getPortalObject().campus.students
    3132
     
    3738    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
    3839    response.write("%s<br>\n\r" % s)
    39 levels = ("110","210")
    40 query = In('level',levels)
    41 student_records = aq_students(query)
    42 logger.info('found %d students with levels %s' % (len(student_records), " ".join(levels)))
     40levels_to_look_for = ("110","210")
     41# query = In('level',levels_to_look_for)
     42# student_records = aq_students(query)
     43# logger.info('found %d students with levels %s' % (len(student_records), " ".join(levels_to_look_for)))
     44# students = {}
     45# for student_record in student_records:
     46#     students[student_record.id] = student_record.level
     47query = In('id',levels_to_look_for) & Eq('portal_type','StudentStudyLevel')
     48levels= aq_portal(query)
     49logger.info('found %d students with levels %s' % (len(levels), " ".join(levels_to_look_for)))
    4350students = {}
    44 for student_record in student_records:
    45     students[student_record.id] = student_record.level
     51for level in levels:
     52    student_id = level.getPath().split('/')[-3]
     53    students[student_id] = level.getId
    4654
    4755for student_id,level in students.items():
Note: See TracChangeset for help on using the changeset viewer.