Ignore:
Timestamp:
16 May 2011, 14:07:54 (13 years ago)
Author:
uli
Message:
  • Fix imports.
  • Add Applicants Catalog.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicants.py

    r6114 r6115  
    2121##
    2222import grok
     23from grok import index
    2324from zope.component.interfaces import IFactory
    2425from zope.interface import implementedBy
    2526from zope.schema.fieldproperty import FieldProperty
    2627from waeup.sirp.interfaces import IWAeUPSIRPPluggable
     28from waeup.sirp.app import University
    2729from waeup.sirp.applicants.interfaces import (
    2830    IResultEntry, IApplicant, IApplicantPDEEditData,
    2931    DEFAULT_PASSPORT_IMAGE_MALE,
    3032    )
    31 from waeup.sirp.utils.helpers import attr_to_fields
     33from waeup.sirp.utils.helpers import attrs_to_fields
    3234
    3335class ResultEntry(grok.Context):
     
    4648# ourselves and as a bonus we get free validation when an attribute is
    4749# set.
    48 Applicant = attr_to_fields(Applicant)
     50Applicant = attrs_to_fields(Applicant)
     51
     52class ApplicantCatalog(grok.Indexes):
     53    """A catalog indexing :class:`Applicant` instances in the ZODB.
     54    """
     55    grok.site(University)
     56    grok.name('applicants_catalog')
     57    grok.context(IApplicant)
     58
     59    access_code = index.Field(attribute='access_code')
     60
    4961
    5062class ApplicantTraverser(grok.Traverser):
Note: See TracChangeset for help on using the changeset viewer.