- Timestamp:
- 9 Nov 2011, 15:42:45 (13 years ago)
- Location:
- main/waeup.sirp/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk
- Property svn:mergeinfo changed
/main/waeup.sirp/branches/ulif-extimgstore (added) merged: 7001-7002,7010-7011,7016,7031-7041,7043-7044,7046-7055
- Property svn:mergeinfo changed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py
r6915 r7063 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. … … 370 348 required = False, 371 349 ) 372 passport = ImageFile(373 title = u'Passport Photograph',374 #default = DEFAULT_PASSPORT_IMAGE_MALE,375 defaultFactory = default_passport_image,376 description = u'Maximun file size is 20 kB.',377 required = True,378 max_size = 20480,379 )350 #passport = ImageFile( 351 # title = u'Passport Photograph', 352 # #default = DEFAULT_PASSPORT_IMAGE_MALE, 353 # defaultFactory = default_passport_image, 354 # description = u'Maximun file size is 20 kB.', 355 # required = True, 356 # max_size = 20480, 357 # ) 380 358 381 359 #
Note: See TracChangeset for help on using the changeset viewer.