code: def filter(cls, **kwargs):
          
          qs = cls.all()
          for key in kwargs:
              qs = filter(lambda i: make_compare(key, kwargs[key], i), qs)
          return qs
docs: The meat. Filtering using Django model style syntax.
  
          All kwargs are translated into attributes on the underlying objects.
          If the attribute is not found, it looks for a similar key
          in the tags.
  
          There are a couple comparisons to check against as well:
              exact: check strict equality
              iexact: case insensitive exact
              like: check against regular expression
              ilike: case insensitive like
              contains: check if string is found with attribute
              icontains: case insensitive contains
              startswith: check if attribute value starts with the string
              istartswith: case insensitive startswith
              endswith: check if attribute value ends with the string
              iendswith: case insensitive startswith
              isnull: check if the attribute does not exist
  
          >>> ec2.instances.filter(name__startswith='production')
          [ ... ]