Changeset 6405 for main


Ignore:
Timestamp:
19 Jun 2011, 12:43:05 (14 years ago)
Author:
Henrik Bettermann
Message:

We don't need to search the academics section so far.

Location:
main/waeup.sirp/branches/accesscodes-with-workflow/src/waeup/sirp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/branches/accesscodes-with-workflow/src/waeup/sirp/browser/pages.py

    r6368 r6405  
    3737    ILocalRolesAssignable, DuplicationError)
    3838from waeup.sirp.permissions import get_users_with_local_roles, getRoles
    39 from waeup.sirp.university.catalog import search
     39#from waeup.sirp.university.catalog import search
    4040from waeup.sirp.university.vocabularies import course_levels
    4141from waeup.sirp.users import LocalRoleSetEvent
     
    347347
    348348
    349 class SearchPage(WAeUPPage):
    350     grok.context(IUniversity)
    351     grok.name('search')
    352     grok.template('searchpage')
    353     grok.require('waeup.manageUniversity')
    354     title = u"Site Search"
    355     pnav = 2
    356 
    357     def update(self, *args, **kw):
    358         form = self.request.form
    359         self.hitlist = []
    360         self.query = ''
    361         if not 'query' in form:
    362             return
    363         query = form['query']
    364         self.query = query
    365         self.hitlist = search(query=self.query, view=self)
    366         return
     349#class SearchPage(WAeUPPage):
     350#    grok.context(IUniversity)
     351#    grok.name('search')
     352#    grok.template('searchpage')
     353#    grok.require('waeup.manageUniversity')
     354#    title = u"Site Search"
     355#    pnav = 2
     356
     357#    def update(self, *args, **kw):
     358#        form = self.request.form
     359#        self.hitlist = []
     360#        self.query = ''
     361#        if not 'query' in form:
     362#            return
     363#        query = form['query']
     364#        self.query = query
     365#        self.hitlist = search(query=self.query, view=self)
     366#        return
    367367
    368368#
  • main/waeup.sirp/branches/accesscodes-with-workflow/src/waeup/sirp/browser/test_permissions.py

    r6212 r6405  
    2020manager_pages = [
    2121    # The pages that should only be accessible by manager...
    22     '/@@manage', '/@@administration', '/@@searchstudent', '/@@search',
     22    '/@@manage', '/@@administration', '/@@searchstudent',
    2323    '/users/@@index', '/users/@@add', '/users/alice/@@index',
    2424    '/datacenter/@@index', '/datacenter/@@upload', '/datacenter/@@import1',
  • main/waeup.sirp/branches/accesscodes-with-workflow/src/waeup/sirp/university/catalog.py

    r6220 r6405  
    9292    return
    9393
    94 class CourseQueryResultItem(QueryResultItem):
    95     def __init__(self, context, view):
    96         self.context = context
    97         self.url = view.url(context)
    98         self.title = "COURSE: " + context.title
    99         self.description = 'code: %s' % context.code
     94#class CourseQueryResultItem(QueryResultItem):
     95#    def __init__(self, context, view):
     96#        self.context = context
     97#        self.url = view.url(context)
     98#        self.title = "COURSE: " + context.title
     99#        self.description = 'code: %s' % context.code
    100100
    101 def search(query=None, view=None):
    102     if not query:
    103         return []
    104     cat = getUtility(ICatalog, name='courses_catalog')
    105     results = list(cat.searchResults(code=(query, query)))
     101#def search(query=None, view=None):
     102#    if not query:
     103#        return []
     104#    cat = getUtility(ICatalog, name='courses_catalog')
     105#    results = list(cat.searchResults(code=(query, query)))
    106106
    107     hitlist = []
    108     results = Query().searchResults(
    109         Eq(('courses_catalog', 'code'), query))
    110     for result in results:
    111         hitlist.append(CourseQueryResultItem(result, view=view))
     107#    hitlist = []
     108#    results = Query().searchResults(
     109#        Eq(('courses_catalog', 'code'), query))
     110#    for result in results:
     111#        hitlist.append(CourseQueryResultItem(result, view=view))
    112112
    113     results = Query().searchResults(
    114         Text(('courses_catalog', 'title'), query))
     113#    results = Query().searchResults(
     114#        Text(('courses_catalog', 'title'), query))
    115115
    116     for result in results:
    117         hitlist.append(CourseQueryResultItem(result, view=view))
     116#    for result in results:
     117#        hitlist.append(CourseQueryResultItem(result, view=view))
    118118
    119     return hitlist
     119#    return hitlist
Note: See TracChangeset for help on using the changeset viewer.