  
      def db_type(self, connection):
          return 'hstore'
  
      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)
  
      def get_transform(self, name):
          transform = super(HStoreField, self).get_transform(name)
          if transform:
              return transform
          return KeyTransformFactory(name)
 
</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 @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                            'second', 'search', 'regex', 'iregex'):
 </s> add                            'second', 'search', 'regex', 'iregex', 'contains',
                           'icontains', 'iexact', 'startswith', 'endswith',
                           'istartswith', 'iendswith'): </s> remove 
    @property
    def output_field(self):
        return IntegerField()
 </s> add     output_field = IntegerField()
  
      def db_type(self, connection):
          return 'hstore'
  






      def get_transform(self, name):
          transform = super(HStoreField, self).get_transform(name)
          if transform:
              return transform
          return KeyTransformFactory(name)
keep keep keep keep 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/contrib/postgres/fields/hstore.py