Changeset 7047


Ignore:
Timestamp:
8 Nov 2011, 22:23:27 (13 years ago)
Author:
uli
Message:

Remove obsolete imports and image field default provider.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/branches/ulif-extimgstore/src/waeup/sirp/applicants/interfaces.py

    r7002 r7047  
    2929
    3030from zope import schema
    31 from zope.interface import Interface, Attribute, provider
     31from zope.interface import Interface, Attribute
    3232from zope.component import getUtilitiesFor
    3333from zope.pluggableauth.interfaces import IPrincipalInfo
    3434from zope.security.interfaces import IGroupClosureAwarePrincipal as IPrincipal
    3535from zc.sourcefactory.basic import BasicSourceFactory
    36 from waeup.sirp.image import createWAeUPImageFile
    37 from waeup.sirp.image.schema import ImageFile
    3836from waeup.sirp.interfaces import IWAeUPObject, year_range
    3937from waeup.sirp.university.vocabularies import application_categories
     
    6664    return True
    6765
    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 the
    73     default directly in ImageFile fields, as, if we want to set
    74     max_size or min_size as well, some utility lookups are needed
    75     which are not possible during startup.
    76 
    77     Developers which use IContextAwareDefaultFactories like this one
    78     always should make sure that the delivered default meets all
    79     constraints of the field that makes use of this default value
    80     provider.
    81     """
    82     imagefile = createWAeUPImageFile(
    83         'placeholder_m.jpg',
    84         open(os.path.join(IMAGE_PATH, 'placeholder_m.jpg'), 'r')
    85         )
    86     return imagefile
    87 
    8866class ApplicantContainerProviderSource(BasicSourceFactory):
    8967    """A source offering all available applicants container types.
Note: See TracChangeset for help on using the changeset viewer.