Changeset 6913
- Timestamp:
- 19 Oct 2011, 17:17:23 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/university/catalog.py
r6839 r6913 35 35 code = grok.index.Field(attribute='code') 36 36 application_category = grok.index.Field(attribute='application_category') 37 title = grok.index.Text(attribute='title') 37 38 38 39 class CertificateCoursesIndexes(grok.Indexes): … … 118 119 self.type = 'Course' 119 120 121 class CertificatesQueryResultItem(object): 122 grok.implements(IQueryResultItem) 123 124 def __init__(self, context, view): 125 self.context = context 126 self.url = view.url(context) 127 self.title = context.title 128 self.code = context.code 129 self.type = 'Certificate' 130 120 131 class CertificateCoursesQueryResultItem(object): 121 132 grok.implements(IQueryResultItem) … … 143 154 for result in results: 144 155 hitlist.append(CoursesQueryResultItem(result, view=view)) 145 156 results = Query().searchResults( 157 Eq(('certificates_catalog', 'code'), query)) 158 for result in results: 159 hitlist.append(CertificatesQueryResultItem(result, view=view)) 160 results = Query().searchResults( 161 Text(('certificates_catalog', 'title'), query)) 162 for result in results: 163 hitlist.append(CertificatesQueryResultItem(result, view=view)) 146 164 results = Query().searchResults( 147 165 Eq(('certcourses_catalog', 'course_code'), query))
Note: See TracChangeset for help on using the changeset viewer.