Ignore:
Timestamp:
7 Mar 2012, 07:55:51 (13 years ago)
Author:
uli
Message:

Rename field interface to more general name.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/branches/ulif-schoolgrades/src/waeup/sirp/schema/field.py

    r7263 r7763  
    1818"""Special fields.
    1919"""
    20 from zope.interface import implements
    21 from zope.schema import TextLine
     20from zope.interface import implements, implementer
     21from zope.schema import TextLine, Object
    2222from zope.schema.interfaces import (
    2323    ITextLine, IBaseVocabulary, ISource, IContextSourceBinder, InvalidValue,)
    2424from zope.schema.vocabulary import (
    2525    SimpleVocabulary, getVocabularyRegistry, VocabularyRegistryError)
     26from waeup.sirp.schema.interfaces import ISchoolGradeEntry
    2627
    2728class CustomizableErrorMsg(object):
     
    125126            raise InvalidValue(value)
    126127        return
     128
     129class MultiValObject(Object):
     130    """A zope.schema.Object-like field for content types with several values.
     131
     132    You can use it like this in interface definitions::
     133
     134      myattr = MultiValObject(
     135        schema = IMyComplexType
     136      )
     137
     138    See :mod:`zope.schema` for further infos about `Object`.
     139
     140    As multi-value objects should normally be rendered different in
     141    forms than single value objects, we need a different schema
     142    definition for these.
     143
     144    In waeup.sirp we also provide widgets that render MultiValObjects
     145    automatically.
     146    """
     147    implements(IMultiValObject)
Note: See TracChangeset for help on using the changeset viewer.