Changeset 6405
- Timestamp:
- 19 Jun 2011, 12:43:05 (14 years ago)
- 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 37 37 ILocalRolesAssignable, DuplicationError) 38 38 from waeup.sirp.permissions import get_users_with_local_roles, getRoles 39 from waeup.sirp.university.catalog import search39 #from waeup.sirp.university.catalog import search 40 40 from waeup.sirp.university.vocabularies import course_levels 41 41 from waeup.sirp.users import LocalRoleSetEvent … … 347 347 348 348 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 = 2356 357 def update(self, *args, **kw):358 form = self.request.form359 self.hitlist = []360 self.query = ''361 if not 'query' in form:362 return363 query = form['query']364 self.query = query365 self.hitlist = search(query=self.query, view=self)366 return349 #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 367 367 368 368 # -
main/waeup.sirp/branches/accesscodes-with-workflow/src/waeup/sirp/browser/test_permissions.py
r6212 r6405 20 20 manager_pages = [ 21 21 # The pages that should only be accessible by manager... 22 '/@@manage', '/@@administration', '/@@searchstudent', '/@@search',22 '/@@manage', '/@@administration', '/@@searchstudent', 23 23 '/users/@@index', '/users/@@add', '/users/alice/@@index', 24 24 '/datacenter/@@index', '/datacenter/@@upload', '/datacenter/@@import1', -
main/waeup.sirp/branches/accesscodes-with-workflow/src/waeup/sirp/university/catalog.py
r6220 r6405 92 92 return 93 93 94 class CourseQueryResultItem(QueryResultItem):95 def __init__(self, context, view):96 self.context = context97 self.url = view.url(context)98 self.title = "COURSE: " + context.title99 self.description = 'code: %s' % context.code94 #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 100 100 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))) 106 106 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)) 112 112 113 results = Query().searchResults(114 Text(('courses_catalog', 'title'), query))113 # results = Query().searchResults( 114 # Text(('courses_catalog', 'title'), query)) 115 115 116 for result in results:117 hitlist.append(CourseQueryResultItem(result, view=view))116 # for result in results: 117 # hitlist.append(CourseQueryResultItem(result, view=view)) 118 118 119 return hitlist119 # return hitlist
Note: See TracChangeset for help on using the changeset viewer.