- Timestamp:
- 9 May 2012, 22:34:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py
r8383 r8404 20 20 from cStringIO import StringIO 21 21 from grok import index 22 from hurry.query import Eq, Text 23 from hurry.query.query import Query 22 24 from zope.component import getUtility, createObject, getAdapter 23 25 from zope.component.interfaces import IFactory … … 37 39 from waeup.kofa.applicants.interfaces import IApplicant, IApplicantEdit 38 40 from waeup.kofa.applicants.workflow import application_states_dict 41 42 def search(query=None, searchtype=None, view=None): 43 if searchtype in ('fullname',): 44 results = Query().searchResults( 45 Text(('applicants_catalog', searchtype), query)) 46 else: 47 results = Query().searchResults( 48 Eq(('applicants_catalog', searchtype), query)) 49 return results 39 50 40 51 class Applicant(grok.Container): … … 157 168 Applicant = attrs_to_fields(Applicant) 158 169 159 class Applicant Catalog(grok.Indexes):170 class ApplicantsCatalog(grok.Indexes): 160 171 """A catalog indexing :class:`Applicant` instances in the ZODB. 161 172 """ … … 164 175 grok.context(IApplicant) 165 176 166 #access_code = index.Field(attribute='access_code')177 fullname = index.Text(attribute='display_fullname') 167 178 applicant_id = index.Field(attribute='applicant_id') 168 179 reg_number = index.Field(attribute='reg_number')
Note: See TracChangeset for help on using the changeset viewer.