def add_to_query(self, query, alias, col, source, is_summary=False):
        if self.dictionary:
            # test for if is a valid transform, if not will raise error
            source.get_transform(self.dictionary)
        else:
            self.dictionary = source.dictionary

        lookup = source.get_lookup(self.srt_lookup)
        fts_query = lookup.lookup_sql % (
            '.'.join('"%s"' % c for c in col), self.dictionary, '%s')
        params = source._get_db_prep_lookup(self.srt_lookup, self.rhs)

        self.extra = {
            'params': params,
            'dictionary': self.dictionary,
            '_normalization': self.normalization,
            '_weights': self.weights
        }

        query.add_extra(
            select=None,
            select_params=None,
            where=[("%s") % fts_query],
            params=[params],
            tables=None,
            order_by=None
        )

        aggregate = AggregateRegister(
            col,
            source=source,
            sql_function=self.sql_function,
            **self.extra)
        query.aggregates[alias] = aggregate
        # in case of related
        if col not in query.group_by:
            query.group_by.append(col)
dataset/ETHPy150Open dvdmgl/django-pg-fts/pg_fts/ranks.py/RankBase.add_to_query/swapped operands of `%`