def open_file(self, store=current_store, use_seek=False):
        """Opens the file-like object which is a context manager
        (that means it can used for :keyword:`with` statement).

        If ``use_seek`` is :const:`True` (though :const:`False` by default)
        it guarentees the returned file-like object is also seekable
        (provides :meth:`~file.seek()` method).

        :param store: the storage which contains image files.
                      :data:`~sqlalchemy_imageattach.context.current_store`
                      by default
        :type store: :class:`~sqlalchemy_imageattach.store.Store`
        :returns: the file-like object of the image, which is a context
                  manager (plus, also seekable only if ``use_seek``
                  is :const:`True`)
        :rtype: :class:`file`,
                :class:`~sqlalchemy_imageattach.file.FileProxy`,
                file-like object

        """
        if not isinstance(store, Store):
            raise TypeError('store must be an instance of '
                            'sqlalchemy_imageattach.store.Store, not ' +
                            repr(store))

        if Session.object_session(self) is None:
            try:
                file = self.file
            except AttributeError:
                raise IOError('no stored original image file')
            return ReusableFileProxy(file)

        return store.open(self, use_seek)
def open_file ( self , store = current_store , use_seek = False ) : if not isinstance ( store , Store ) : raise TypeError ( 'store must be an instance of ' 'sqlalchemy_imageattach.store.Store, not ' + repr ( store ) ) if Session . object_session ( self ) is None : try : file = self . file except AttributeError : raise IOError ( 'no stored original image file' ) return ReusableFileProxy ( file ) return store . open ( self , use_seek )
Opens the file-like object which is a context manager
        (that means it can used for :keyword:`with` statement).

        If ``use_seek`` is :const:`True` (though :const:`False` by default)
        it guarentees the returned file-like object is also seekable
        (provides :meth:`~file.seek()` method).

        :param store: the storage which contains image files.
                      :data:`~sqlalchemy_imageattach.context.current_store`
                      by default
        :type store: :class:`~sqlalchemy_imageattach.store.Store`
        :returns: the file-like object of the image, which is a context
                  manager (plus, also seekable only if ``use_seek``
                  is :const:`True`)
        :rtype: :class:`file`,
                :class:`~sqlalchemy_imageattach.file.FileProxy`,
                file-like object