def filter_with_schema(self, collection=None, context=None):
        """ Perform collection items filtering with schema """
        if collection is None or self.schema is None:
            return

        try:
            for item in collection:
                self._schema.filter(
                    model=item,
                    context=context if self.use_context else None
                )
        except TypeError:
            pass
def filter_with_schema ( self , collection = None , context = None ) : if collection is None or self . schema is None : return try : for item in collection : self . _schema . filter ( model = item , context = context if self . use_context else None ) except TypeError : pass
Perform collection items filtering with schema