jarvis/Database.py
def filter(self, filter: any = {}) -> list:
        """THE USE OF THIS FUNCTION IS DISCOURAGED! USE FIND INSTEAD!
        Filters a table  
        `filter` can be either a lamba or object  
        Returns a list of all documents that match"""
        doc_list = DocumentList(self)
        if (isinstance(filter, types.LambdaType)):
            for document in self.all():
                if filter.__call__(document):
                    doc_list.add(document)
        if (isinstance(filter, dict)):
            if len(filter) == 0:
                return self.all()
            for document in self.all():
                for key in filter:
                    if key in document and document[key] == filter[key]:
                        doc_list.add(document)
        return doc_list
THE USE OF THIS FUNCTION IS DISCOURAGED! USE FIND INSTEAD!
        Filters a table  
        `filter` can be either a lamba or object  
        Returns a list of all documents that match
THE USE OF THIS FUNCTION IS DISCOURAGED. USE FIND INSTEAD.
Filters a table
`filter` can be either a lamba or object
Returns a list of all documents that match
THE USE OF THIS FUNCTION IS DISCOURAGED . USE FIND INSTEAD . Filters a table ` filter ` can be either a lamba or object Returns a list of all documents that match
def filter(self, filter: any = {}) -> list:
        doc_list = DocumentList(self)
        if (isinstance(filter, types.LambdaType)):
            for document in self.all():
                if filter.__call__(document):
                    doc_list.add(document)
        if (isinstance(filter, dict)):
            if len(filter) == 0:
                return self.all()
            for document in self.all():
                for key in filter:
                    if key in document and document[key] == filter[key]:
                        doc_list.add(document)
        return doc_list
def filter ( self , filter : any = { } ) -> list : doc_list = DocumentList ( self ) if ( isinstance ( filter , types . LambdaType ) ) : for document in self . all ( ) : if filter . __call__ ( document ) : doc_list . add ( document ) if ( isinstance ( filter , dict ) ) : if len ( filter ) == 0 : return self . all ( ) for document in self . all ( ) : for key in filter : if key in document and document [ key ] == filter [ key ] : doc_list . add ( document ) return doc_list
THE USE OF THIS FUNCTION IS DISCOURAGED!
THE USE OF THIS FUNCTION IS DISCOURAGED!
"""THE USE OF THIS FUNCTION IS DISCOURAGED! USE FIND INSTEAD!
        Filters a table  
        `filter` can be either a lamba or object  
        Returns a list of all documents that match"""
self
filter
any