def search(self, model, term):
        sources = self.get_db_sources(model)
        column_queries = []
        for source in sources:
            handler = self.get_source_handler(model, source)

            for sub_source in self.expand_source(source):
                modelfield = resolve_orm_path(model, sub_source)
                if modelfield.choices:
                    for db_value, label in modelfield.get_flatchoices():
                        if term.lower() in label.lower():
                            k = '%s__exact' % (sub_source,)
                            column_queries.append(Q(**{k: str(db_value)}))

                lookup_types = handler.get_lookup_types()
                for lookup_type in lookup_types:
                    coerced_term = handler.prep_search_value(term, lookup_type)
                    if coerced_term is None:
                        # Skip terms that don't work with the lookup_type
                        continue
                    elif lookup_type in ('in', 'range') and not isinstance(coerced_term, tuple):
                        # Skip attempts to build multi-component searches if we only have one term
                        continue

                    k = '%s__%s' % (sub_source, lookup_type)
                    column_queries.append(Q(**{k: coerced_term}))

        if column_queries:
            q = reduce(operator.or_, column_queries)
        else:
            q = None
        return q

    # Template rendering
A rectangle (obviously).
dataset/ETHPy150Open pivotal-energy-solutions/django-datatable-view/datatableview/columns.py/Column.search--crossover with--dataset/ETHPy150Open glue-viz/glue/glue/core/layout.py/Rectangle.__init__