                  sql, params = value._as_sql(connection=connection)
              return QueryWrapper(('(%s)' % sql), params)
  
          if lookup_type in ('month', 'day', 'week_day', 'hour', 'minute',
                             'second', 'search', 'regex', 'iregex'):
              return [value]
          elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte'):
              return [self.get_db_prep_value(value, connection=connection,
                                             prepared=prepared)]
          elif lookup_type in ('range', 'in'):
 
</s> remove         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)]
 </s> add  </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()
                           'second', 'search', 'regex', 'iregex', 'contains',
                           'icontains', 'iexact', 'startswith', 'endswith',
                           'istartswith', 'iendswith'):
                  sql, params = value._as_sql(connection=connection)
              return QueryWrapper(('(%s)' % sql), params)
  
          if lookup_type in ('month', 'day', 'week_day', 'hour', 'minute',
                           'second', 'search', 'regex', 'iregex', 'contains',
                           'icontains', 'iexact', 'startswith', 'endswith',
                           'istartswith', 'iendswith'):
              return [value]
          elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte'):
              return [self.get_db_prep_value(value, connection=connection,
                                             prepared=prepared)]
          elif lookup_type in ('range', 'in'):
keep keep keep keep 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