get joined base filter and current active filter for query
187142
def _get_list_widget(self, **args):
        
        widgets = super(CompactCRUDMixin, self)._get_list_widget(**args)
        session_form_widget = self.get_key("session_form_widget", None)

        form_widget = None
        if session_form_widget == "add":
            form_widget = self._add().get("add")
        elif session_form_widget == "edit":
            pk = self.get_key("session_form_edit_pk")
            if pk and self.datamodel.get(int(pk)):
                form_widget = self._edit(int(pk)).get("edit")
        return {
            "list": GroupFormListWidget(
                list_widget=widgets.get("list"),
                form_widget=form_widget,
                form_action=self.get_key("session_form_action", ""),
                form_title=self.get_key("session_form_title", ""),
            )
        }
542597
protected function GetSQLQueryForQueryRestrictionForActiveFilter()
    {
        $aValues = TTools::MysqlRealEscapeArray($this->aActiveFilterData);
        $sEscapedTargetTable = MySqlLegacySupport::getInstance()->real_escape_string($this->sItemTableName);
        $sEscapedTargetMLTTable = MySqlLegacySupport::getInstance()->real_escape_string('shop_article_'.$this->sItemTableName.'_mlt');

        $sItemListQuery = "SELECT `{$sEscapedTargetMLTTable}`.*
                           FROM `{$sEscapedTargetTable}`
                     INNER JOIN `{$sEscapedTargetMLTTable}` ON `{$sEscapedTargetTable}`.`id` = `{$sEscapedTargetMLTTable}`.`target_id`
                          WHERE ".$this->GetTargetTableNameField()." IN ('".implode("','", $aValues)."')";

        return $sItemListQuery;
    }
1311155
def apply_filters(query, args):
    
    pre_joins = []
    for querystring_key, filter_value in args.items(multi=True):
        if querystring_key in filter_registry:
            cls_inst = filter_registry[querystring_key]
            query = cls_inst.apply_filter(query, args, pre_joins)
        elif querystring_key in PaginationKeys._value_list:
            pass
        else:
            raise InvalidQueryString(querystring_key, filter_value)
    return query
999607
function(filter){
      filter = filter || this.filter;

      var cursor = this.cursor_ || this.root_;

      do
      {
        var node = cursor[this.a]; // next child
        while (!node)
        {
          if (cursor === this.root_)
            return this.cursor_ = null;

          node = cursor[this.b]; // next sibling

          if (!node)
            cursor = cursor[PARENT_NODE];
        }
      }
      while (!filter(cursor = node));

      return this.cursor_ = cursor;
    }
735237
def filter(self, table, group_types, filter_string):
        """"""
        query = filter_string.lower()
        return [group_type for group_type in group_types
                if query in group_type.name.lower()]
1023275
def filter(self, *args, **kwargs):
		""""""
		if 'pk' in kwargs or 'id' in kwargs:
			return self.all_with_deleted().filter(*args, **kwargs)
		return self.get_query_set().filter(*args, **kwargs)
1339836
function queryFilter(where) {
  if (where.$or) {
    return object =>
      _.reduce(where.$or, (result, subclause) => result ||
        queryFilter(subclause)(object), false);
  }

  // Go through each key in where clause
  return object => _.reduce(where, (result, whereParams, key) => {
    const match = evaluateObject(object, whereParams, key);
    return result && match;
  }, true);
}
278444
def get_active() -> List[str]:
        """"""
        active = []
        for i in range(__num_subarrays__):
            key = Subarray.get_key(i)
            if DB.get_hash_value(key, 'active').upper() == 'TRUE':
                active.append(Subarray.get_id(i))
        return active
1362589
def filter(self, *query_filter):
        '''
        '''
        for query in query_filter:
            self.query.append(query)
        return self
122773
def base_query
      ActionLog
        .where(visibility: %w(public-only all))
        .where(organization: options.fetch(:organization))
    end
908372
function () {
			this.writeDebug('checkQueryStringFilters',arguments);

			// Loop through the filters.
			for(var key in filters) {
				if (filters.hasOwnProperty(key)) {
					var filterVal = this.getQueryString(key);

					// Check for multiple values separated by comma.
					if ( filterVal.indexOf( ',' ) !== -1 ) {
						filterVal = filterVal.split( ',' );
					}

					// Only add the taxonomy id if it doesn't already exist
					if (typeof filterVal !== 'undefined' && filterVal !== '' && filters[key].indexOf(filterVal) === -1) {
						if ( Array.isArray( filterVal ) ) {
							filters[key] = filterVal;
						} else {
							filters[key] = [filterVal];
						}
					}

					// Select the filters indicated in the query string.
					if ( filters[key].length ) {
						this.selectQueryStringFilters( key, filters[key] );
					}
				}
			}

		}
614615
def _filter(self, query, **kwargs):
        
        query = self._auto_filter(query, **kwargs)
        return query
474933
async def filter(self, request):
        """"""
        collection = self.collection
        self.filter_form.process(request.query)
        data = self.filter_form.data
        self.filter_form.active = any(o and o is not DEFAULT for o in data.values())
        for flt in self.columns_filters:
            try:
                collection = flt.apply(collection, data)
            # Invalid filter value
            except ValueError:
                continue
        return collection
550209
public function GetQueryRestrictionForActiveFilter()
    {
        $sQuery = $this->GetFromInternalCache('sQueryRestrictionForActiveFilter');
        if (is_null($sQuery)) {
            $aValues = $this->aActiveFilterData;
            if (is_array($aValues) && count($aValues) > 0) {
                $aValues = TTools::MysqlRealEscapeArray($aValues);
                $sItemListQuery = 'SELECT * FROM `'.MySqlLegacySupport::getInstance()->real_escape_string($this->sItemTableName).'` WHERE '.$this->GetTargetTableNameField()." IN ('".implode("','", $aValues)."')";
                $tRes = MySqlLegacySupport::getInstance()->query($sItemListQuery);
                $aIdList = array();
                while ($aItemRow = MySqlLegacySupport::getInstance()->fetch_assoc($tRes)) {
                    $aIdList[] = MySqlLegacySupport::getInstance()->real_escape_string($aItemRow['id']);
                }

                if (count($aIdList) > 0) {
                    $sQuery = '`shop_article`.`'.MySqlLegacySupport::getInstance()->real_escape_string($this->sItemFieldName)."` IN ('".implode("','", $aIdList)."')";
                }
            }
            $this->SetInternalCache('sQueryRestrictionForActiveFilter', $sQuery);
        }

        return $sQuery;
    }
773465
function ( query, associations ) {
		_.each( associations, function ( assoc ) {
			// if the associations is to be populated with the full records...
			if ( assoc.include === "record" ) query.populate( assoc.alias );
		} );
		return query;
	}
135904
public function activeFilters()
    {
        $state = $this->activeState();

        $result = [];
        foreach ($state->activeFilters() as $name) {
            if (!isset($this->filters[$name])) {
                //No such filter
                continue;
            }

            $filter = $this->filters[$name];
            $value = $state->getValue($name);

            if ($filter->isApplicable($value)) {
                $result[$name] = $filter->withValue($value);
            }
        }

        return $result;
    }
437919
def attach_core_filters(cls):
        
        opts = cls._meta
        base_filters = cls.base_filters.copy()
        cls.base_filters.clear()
        for name, filter_ in six.iteritems(base_filters):
            if isinstance(filter_, AutoFilters):
                field = filterset.get_model_field(opts.model, filter_.name)
                filter_exclusion = filter_.extra.pop('drop', [])
                for lookup_expr in utils.lookups_for_field(field):
                    if lookup_expr not in filter_exclusion:
                        new_filter = cls.filter_for_field(field, filter_.name, lookup_expr)
                        # by convention use field name for filters with exact lookup_expr
                        if lookup_expr != 'exact':
                            filter_name = LOOKUP_SEP.join([name, lookup_expr])
                        else:
                            filter_name = name
                        cls.base_filters[filter_name] = new_filter