Changeset 6290 for main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Timestamp:
- 6 Jun 2011, 22:47:53 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py
r6285 r6290 28 28 29 29 from zope import schema 30 from zope.interface import Interface, Attribute 30 from zope.interface import Interface, Attribute, provider 31 31 from zope.component import getUtility, getUtilitiesFor 32 32 from zope.pluggableauth.interfaces import IPrincipalInfo … … 56 56 ) 57 57 58 @provider(schema.interfaces.IContextAwareDefaultFactory) 59 def default_passport_image(context): 60 """A default value factory for ImageFile fields. 61 62 Returns some default image as WAeUPImageFile. We cannot set the 63 default directly in ImageFile fields, as, if we want to set 64 max_size or min_size as well, some utility lookups are needed 65 which are not possible during startup. 66 67 Developers which use IContextAwareDefaultFactories like this one 68 always should make sure that the delivered default meets all 69 constraints of the field that makes use of this default value 70 provider. 71 """ 72 return DEFAULT_PASSPORT_IMAGE_MALE 73 58 74 class ApplicantContainerProviderSource(BasicSourceFactory): 59 75 """A source offering all available applicants container types. … … 332 348 passport = ImageFile( 333 349 title = u'Passport Photograph', 334 default = DEFAULT_PASSPORT_IMAGE_MALE, 350 #default = DEFAULT_PASSPORT_IMAGE_MALE, 351 defaultFactory = default_passport_image, 335 352 required = True, 336 353 max_size = 20480,
Note: See TracChangeset for help on using the changeset viewer.