Changeset 7047
- Timestamp:
- 8 Nov 2011, 22:23:27 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/branches/ulif-extimgstore/src/waeup/sirp/applicants/interfaces.py
r7002 r7047 29 29 30 30 from zope import schema 31 from zope.interface import Interface, Attribute , provider31 from zope.interface import Interface, Attribute 32 32 from zope.component import getUtilitiesFor 33 33 from zope.pluggableauth.interfaces import IPrincipalInfo 34 34 from zope.security.interfaces import IGroupClosureAwarePrincipal as IPrincipal 35 35 from zc.sourcefactory.basic import BasicSourceFactory 36 from waeup.sirp.image import createWAeUPImageFile37 from waeup.sirp.image.schema import ImageFile38 36 from waeup.sirp.interfaces import IWAeUPObject, year_range 39 37 from waeup.sirp.university.vocabularies import application_categories … … 66 64 return True 67 65 68 @provider(schema.interfaces.IContextAwareDefaultFactory)69 def default_passport_image(context):70 """A default value factory for ImageFile fields.71 72 Returns some default image as WAeUPImageFile. We cannot set the73 default directly in ImageFile fields, as, if we want to set74 max_size or min_size as well, some utility lookups are needed75 which are not possible during startup.76 77 Developers which use IContextAwareDefaultFactories like this one78 always should make sure that the delivered default meets all79 constraints of the field that makes use of this default value80 provider.81 """82 imagefile = createWAeUPImageFile(83 'placeholder_m.jpg',84 open(os.path.join(IMAGE_PATH, 'placeholder_m.jpg'), 'r')85 )86 return imagefile87 88 66 class ApplicantContainerProviderSource(BasicSourceFactory): 89 67 """A source offering all available applicants container types.
Note: See TracChangeset for help on using the changeset viewer.