versatileimagefield/registry.py
def register_filter(self, attr_name, filterimage_cls):
        """
        Register a new FilteredImage subclass (`filterimage_cls`).

        To be used via the attribute (filters.`attr_name`)
        """
        if attr_name.startswith('_'):
            raise UnallowedFilterName(
                '`%s` is an unallowed Filter name. Filter names cannot begin '
                'with an underscore.' % attr_name
            )
        if not issubclass(filterimage_cls, FilteredImage):
            raise InvalidFilteredImageSubclass(
                'Only subclasses of FilteredImage may be registered as '
                'filters with VersatileImageFieldRegistry'
            )

        if attr_name in self._filter_registry:
            raise AlreadyRegistered(
                'A ProcessedImageMixIn class is already registered to the `%s`'
                ' attribute. If you would like to override this attribute, '
                'use the unregister method' % attr_name
            )
        else:
            self._filter_registry[attr_name] = filterimage_cls
def register_filter(self, attr_name, filterimage_cls):
        """
        Register a new FilteredImage subclass (`filterimage_cls`).

        To be used via the attribute (filters.`attr_name`)
        """
        if attr_name.startswith('_'):
            raise UnallowedFilterName(
                '`%s` is an unallowed Filter name. Filter names cannot begin '
                'with an underscore.' % attr_name
            )
        if not issubclass(filterimage_cls, FilteredImage):
            raise InvalidFilteredImageSubclass(
                'Only subclasses of FilteredImage may be registered as '
                'filters with VersatileImageFieldRegistry'
            )

        if attr_name in self._filter_registry:
            raise AlreadyRegistered(
                'A ProcessedImageMixIn class is already registered to the `%s`'
                ' attribute. If you would like to override this attribute, '
                'use the unregister method' % attr_name
            )
        else:
            self._filter_registry[attr_name] = filterimage_cls
def register_filter ( self , attr_name , filterimage_cls ) : if attr_name . startswith ( '_' ) : raise UnallowedFilterName ( '`%s` is an unallowed Filter name. Filter names cannot begin ' 'with an underscore.' % attr_name ) if not issubclass ( filterimage_cls , FilteredImage ) : raise InvalidFilteredImageSubclass ( 'Only subclasses of FilteredImage may be registered as ' 'filters with VersatileImageFieldRegistry' ) if attr_name in self . _filter_registry : raise AlreadyRegistered ( 'A ProcessedImageMixIn class is already registered to the `%s`' ' attribute. If you would like to override this attribute, ' 'use the unregister method' % attr_name ) else : self . _filter_registry [ attr_name ] = filterimage_cls
Register a new FilteredImage subclass (`filterimage_cls`).

        To be used via the attribute (filters.`attr_name`)
Register a new FilteredImage subclass ( filterimage_cls ) .