                                             prepared=prepared)]
          elif lookup_type in ('range', 'in'):
              return [self.get_db_prep_value(v, connection=connection,
                                             prepared=prepared) for v in value]
          elif lookup_type in ('contains', 'icontains'):
              return ["%%%s%%" % connection.ops.prep_for_like_query(value)]
          elif lookup_type == 'iexact':
              return [connection.ops.prep_for_iexact_query(value)]
          elif lookup_type in ('startswith', 'istartswith'):
              return ["%s%%" % connection.ops.prep_for_like_query(value)]
          elif lookup_type in ('endswith', 'iendswith'):
              return ["%%%s" % connection.ops.prep_for_like_query(value)]
          elif lookup_type == 'isnull':
              return []
          elif lookup_type == 'year':
              if isinstance(self, DateTimeField):
                  return connection.ops.year_lookup_bounds_for_datetime_field(value)
 
</s> remove                            'second', 'search', 'regex', 'iregex'):
 </s> add                            'second', 'search', 'regex', 'iregex', 'contains',
                           'icontains', 'iexact', 'startswith', 'endswith',
                           'istartswith', 'iendswith'): </s> remove     def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False):
        if lookup_type == 'contains':
            return [self.get_prep_value(value)]
        return super(HStoreField, self).get_db_prep_lookup(lookup_type, value,
                connection, prepared=False)

 </s> add  </s> remove 
    @property
    def output_field(self):
        return IntegerField()
 </s> add     output_field = IntegerField() </s> remove @HStoreField.register_lookup
class HStoreContainsLookup(Lookup):
    lookup_name = 'contains'

    def as_sql(self, compiler, connection):
        lhs, lhs_params = self.process_lhs(compiler, connection)
        rhs, rhs_params = self.process_rhs(compiler, connection)
        params = lhs_params + rhs_params
        return '%s @> %s' % (lhs, rhs), params


@HStoreField.register_lookup
class HStoreContainedByLookup(Lookup):
    lookup_name = 'contained_by'

    def as_sql(self, compiler, connection):
        lhs, lhs_params = self.process_lhs(compiler, connection)
        rhs, rhs_params = self.process_rhs(compiler, connection)
        params = lhs_params + rhs_params
        return '%s <@ %s' % (lhs, rhs), params
 </s> add HStoreField.register_lookup(lookups.DataContains)
HStoreField.register_lookup(lookups.ContainedBy) </s> remove 
    def as_sql(self, compiler, connection):
        lhs, params = compiler.compile(self.lhs)
        return 'avals(%s)' % lhs, params
 </s> add 
                                             prepared=prepared)]
          elif lookup_type in ('range', 'in'):
              return [self.get_db_prep_value(v, connection=connection,
                                             prepared=prepared) for v in value]








          elif lookup_type == 'isnull':
              return []
          elif lookup_type == 'year':
              if isinstance(self, DateTimeField):
                  return connection.ops.year_lookup_bounds_for_datetime_field(value)
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
 Move % addition to lookups, refactor postgres lookups.

These refactorings making overriding some text based lookup names on
other fields (specifically `contains`) much cleaner. It also removes a
bunch of duplication in the contrib.postgres lookups. 
django/db/models/fields/__init__.py