Changeset 1845 for WAeUP_SRP


Ignore:
Timestamp:
2 Jun 2007, 11:01:49 (17 years ago)
Author:
joachim
Message:

modifications to use QueueCatalog?

Location:
WAeUP_SRP/trunk
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTables.py

    r1815 r1845  
    3232p_home = Globals.package_home(globals())
    3333i_home = Globals.INSTANCE_HOME
     34from Products.CMFCore.CatalogTool import CatalogTool
    3435from Products.AdvancedQuery import Eq, Between, Le,In
    3536
     
    4546    return ob
    4647
     48class RealCatalogTool(CatalogTool):
     49    meta_type = 'Catalog Tool Real'
     50    name = id = "portal_catalog_real"
     51   
    4752
    4853class WAeUPTable(ZCatalog): ###(
  • WAeUP_SRP/trunk/__init__.py

    r1825 r1845  
    1212
    1313import PatchCPSWorkflowWorkflowDefinition
     14#import PatchCatalogToolSearchResults
    1415import PatchCatalogToolXMLAdapter
    1516import PatchCPSSchemasAttributeStorageAdapter
     
    2627import PatchCPSDefaultImportExport
    2728import PatchRenderActionIcon
    28 import PatchZODBConnectionOpen
     29#import PatchZODBConnectionOpen
    2930import Products.WAeUP_SRP.WAeUPPermissions
    3031import WAeUPTool
  • WAeUP_SRP/trunk/profiles/default/toolset.xml

    r1625 r1845  
    11<?xml version="1.0"?>
    22<tool-setup>
     3 <required tool_id="portal_catalog_real"
     4           class="Products.WAeUP_SRP.WAeUPTables.RealCatalogTool"/>
    35 <required tool_id="portal_accommodation"
    46           class="Products.WAeUP_SRP.WAeUPTables.AccommodationTable"/>
  • WAeUP_SRP/trunk/skins/waeup_directory/search_members.py

    r953 r1845  
    1111
    1212from Products.CPSDirectory.BaseDirectory import SearchSizeLimitExceeded
     13from Products.AdvancedQuery import Eq, Between, Le,In
     14aq_portal = context.portal_catalog.evalAdvancedQuery
    1315try:
    14     from Products.AdvancedQuery import Eq, Between, Le,In
    15     evalAdvancedQuery = context.portal_catalog.evalAdvancedQuery
     16    aq_portal = context.portal_catalog.evalAdvancedQuery
    1617except:
    17     evalAdvancedQuery = None
     18    aq_portal = context.portal_catalog_real.evalAdvancedQuery
    1819
    1920datamodel = datastructure.getDataModel()
     
    8081    query = In('portal_type',('Faculty','Department')) &\
    8182            In('localUsersWithRoles',('user:%s' % user_id,))
    82     res = evalAdvancedQuery(query)
     83    res = aq_portal(query)
    8384    facs = []
    8485    roles = []
  • WAeUP_SRP/trunk/skins/waeup_epayment/check_online_payments.py

    r1625 r1845  
    3636    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
    3737    response.write("%s<br>\n" % s)
     38from Products.AdvancedQuery import Eq, Between, Le,In
    3839try:
    39     from Products.AdvancedQuery import Eq, Between, Le,In
    4040    aq_portal = context.portal_catalog.evalAdvancedQuery
    41     aq_students = context.students_catalog.evalAdvancedQuery
    4241except:
    43     aq_portal = None
     42    aq_portal = context.portal_catalog_real.evalAdvancedQuery
     43aq_students = context.students_catalog.evalAdvancedQuery
    4444
    4545query1 = Eq('portal_type','Payment')
    46 query2 = Eq('SearchableText',"Approved Successful")             
     46query2 = Eq('SearchableText',"Approved Successful")             
    4747online_payments = aq_portal(query1 & query2)
    4848set_trace()
  • WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py

    r1783 r1845  
    1616if mtool.isAnonymousUser():
    1717    return None
     18try:
     19    from Products.zdb import set_trace
     20except:
     21    def set_trace():
     22        pass
    1823
    1924
     
    3237request = context.REQUEST
    3338students = context.portal_url.getPortalObject().campus.students
    34 
     39#set_trace()
    3540student_id = context.getStudentId()
    3641if student_id is None:
  • WAeUP_SRP/trunk/skins/waeup_student/add_course_result.py

    r1648 r1845  
    2525course_cat = context.courses_catalog
    2626from Products.AdvancedQuery import Eq, Between, Le,In
    27 aq_portal = context.portal_catalog.evalAdvancedQuery
     27try:
     28    aq_portal = context.portal_catalog.evalAdvancedQuery
     29except:
     30    aq_portal = context.portal_catalog_real.evalAdvancedQuery
    2831course_id = request.get('course_id')
    2932
  • WAeUP_SRP/trunk/skins/waeup_student/create_level.py

    r1823 r1845  
    1313        pass
    1414from Products.AdvancedQuery import Eq, Between, Le,In
    15 aq_portal = context.portal_catalog.evalAdvancedQuery
     15try:
     16    aq_portal = context.portal_catalog.evalAdvancedQuery
     17except:
     18    aq_portal = context.portal_catalog_real.evalAdvancedQuery
    1619aq_courses = context.courses_catalog.evalAdvancedQuery
    1720
     
    3740    logger.info('%s tried to add already existing level %s' % (student.id,current_level))
    3841    return
     42logger.info('%s started to create level %s' % (student.id,current_level))
    3943
    4044##if in_progress in ('not started','started'):
     
    5357else:
    5458    context.invokeFactory('StudentStudyLevel',"%s" % current_level)
    55     logger.info('%s started to create level %s' % (student.id,current_level))
    5659    level = getattr(context,"%s" % current_level)
    5760    context.portal_workflow.doActionFor(level,'open')
     
    7679        c_res = aq_courses(query)
    7780        if not c_res:
    78             logger.info('%s", course %s not found in courses_catalog' % (student.id,co.CosCode))
     81            #logger.info('%s", course %s not found in courses_catalog' % (student.id,co.CosCode))
    7982            continue
    8083        course_cat_entry = c_res[0]
     
    8689                score = int(co.Score)
    8790            except:
    88                 logger.info('%s, course %s has invalid score %s"' % (student.id,
    89                                                                     co.CosCode,
    90                                                                     co.Score))
     91                # logger.info('%s, course %s has invalid score %s"' % (student.id,
     92                #                                                     co.CosCode,
     93                #                                                     co.Score))
    9194                continue
    9295            if int(c_res[0].passmark) <= score:
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentReviewState.py

    r1700 r1845  
    1212return the review_state of the Student
    1313"""
     14from Products.AdvancedQuery import Eq, Between, Le,In
    1415try:
    15     from Products.AdvancedQuery import Eq, Between, Le,In
    1616    aq_portal = context.portal_catalog.evalAdvancedQuery
    1717except:
    18     aq_portal = None
     18    aq_portal = context.portal_catalog_real.evalAdvancedQuery
    1919if student_id is None:
    2020    student_id = context.getStudentId()
  • WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py

    r1822 r1845  
    2626       
    2727from Products.AdvancedQuery import Eq, Between, Le,In
    28 aq_portal = context.portal_catalog.evalAdvancedQuery
     28try:
     29    aq_portal = context.portal_catalog.evalAdvancedQuery
     30except:
     31    aq_portal = context.portal_catalog_real.evalAdvancedQuery
    2932request = context.REQUEST
    3033#session = request.SESSION
  • WAeUP_SRP/trunk/skins/waeup_student/refresh_level.py

    r1822 r1845  
    1919        pass
    2020from Products.AdvancedQuery import Eq, Between, Le,In
    21 aq_portal = context.portal_catalog.evalAdvancedQuery
     21try:
     22    aq_portal = context.portal_catalog.evalAdvancedQuery
     23except:
     24    aq_portal = context.portal_catalog_real.evalAdvancedQuery
    2225aq_courses = context.courses_catalog.evalAdvancedQuery
    2326
  • WAeUP_SRP/trunk/skins/waeup_student/search_students.py

    r1582 r1845  
    3131if is_anon:
    3232    allowed = False
     33from Products.AdvancedQuery import Eq, Between, Le,In
    3334try:
    34     from Products.AdvancedQuery import Eq, Between, Le,In
    35     evalAdvancedQuery = context.portal_catalog.evalAdvancedQuery
    36     aq_students = context.students_catalog.evalAdvancedQuery
     35    aq_portal = context.portal_catalog.evalAdvancedQuery
    3736except:
    38     evalAdvancedQuery = None
     37    aq_portal = context.portal_catalog_real.evalAdvancedQuery
     38aq_students = context.students_catalog.evalAdvancedQuery
    3939
    4040def cmp_id(a,b):
     
    8181        query = In('portal_type',('Faculty',)) &\
    8282                 In('localUsersWithRoles', ("user:%s" % member,))
    83         res = evalAdvancedQuery(query)
     83        res = aq_portal(query)
    8484        logger.info('ClearanceOfficer %s initiated student_search' % member)
    8585        faculties = []
     
    9090        query = In('portal_type',('Department',)) &\
    9191                 In('localUsersWithRoles', ("user:%s" % member,))
    92         res = evalAdvancedQuery(query)
     92        res = aq_portal(query)
    9393        departments = []
    9494        if res:
     
    107107        query = In('portal_type',('StudyLevel',)) &\
    108108                 In('localUsersWithRoles', ("user:%s" % member,))
    109         res = evalAdvancedQuery(query)
     109        res = aq_portal(query)
    110110        logger.info('CourseAdviser %s initiated student_search' % member)
    111111        certificate_level = []
     
    195195        query = In('portal_type',pt) & Eq('SearchableText',"%s*" % term.strip())
    196196        logger.info('%s searches for student with name %s' % (member,term))
    197         res = evalAdvancedQuery(query)
     197        res = aq_portal(query)
    198198        if res:
    199199            for r in res:
     
    207207        logger.info('"%s","start 100"' % member)
    208208    query = Eq('review_state',state)
    209     review_res = evalAdvancedQuery(query)
     209    review_res = aq_portal(query)
    210210
    211211    logger.info('%s searches for students in review_state %s' % (member,state))
  • WAeUP_SRP/trunk/skins/waeup_student/student_index.py

    r1822 r1845  
    1212return the current student_index
    1313"""
    14 from Products.AdvancedQuery import Eq, Between, Le,In
    15 evalAdvancedQuery = context.portal_catalog.evalAdvancedQuery
     14# from Products.AdvancedQuery import Eq, Between, Le,In
     15# try:
     16#     aq_portal = context.portal_catalog.evalAdvancedQuery
     17# except:
     18#     aq_portal = context.portal_catalog_real.evalAdvancedQuery
    1619
    1720request = context.REQUEST
Note: See TracChangeset for help on using the changeset viewer.