def create_fts_trigger(self, model, vector_field):

        fields = []
        vectors = []

        if not isinstance(vector_field, TSVectorField):
            raise AttributeError

        try:
            dict_field = model._meta.get_field_by_name(vector_field.dictionary)[0]
            dictionary = "NEW.%s::regconfig" % (
                dict_field.get_attname_column()[1])
            fields.append('NEW.{0} <> OLD.{0}'.format(vector_field.dictionary))
        except:
            dictionary = vector_field.dictionary % "'%s'"

        for field, rank in vector_field._get_fields_and_ranks():
            fields.append('NEW.{0} <> OLD.{0}'.format(
                field.get_attname_column()[1]))
            vectors.append(self._get_vector_for_field(field, rank, dictionary))

        return self.sql_create_trigger.format(
            model=model._meta.db_table,
            fts_name=vector_field.get_attname_column()[1],
            fts_fields=' OR '.join(fields),
            vectors=' || '.join(vectors)
        )
dataset/ETHPy150Open dvdmgl/django-pg-fts/pg_fts/migrations.py/PgFtsSQL.create_fts_trigger/swapped operands of `%`