  
  class IStartsWith(PatternLookup):
      lookup_name = 'istartswith'
  default_lookups['istartswith'] = IStartsWith
  
  
  class EndsWith(PatternLookup):
 
</s> remove class IContains(PatternLookup):
 </s> add class IContains(Contains): </s> remove class Unaccent(Transform):
 </s> add class PostgresSimpleLookup(Lookup):
    def as_sql(self, qn, connection):
        lhs, lhs_params = self.process_lhs(qn, connection)
        rhs, rhs_params = self.process_rhs(qn, connection)
        params = lhs_params + rhs_params
        return '%s %s %s' % (lhs, self.operator, rhs), params


class FunctionTransform(Transform):
    def as_sql(self, qn, connection):
        lhs, params = qn.compile(self.lhs)
        return "%s(%s)" % (self.function, lhs), params


class DataContains(PostgresSimpleLookup):
    lookup_name = 'contains'
    operator = '@>'


class ContainedBy(PostgresSimpleLookup):
    lookup_name = 'contained_by'
    operator = '<@'


class Overlap(PostgresSimpleLookup):
    lookup_name = 'overlap'
    operator = '&&'


class Unaccent(FunctionTransform):
    def process_rhs(self, qn, connection):
        rhs, params = super(IStartsWith, self).process_rhs(qn, connection)
        if params and not self.bilateral_transforms:
            params[0] = "%s%%" % connection.ops.prep_for_like_query(params[0])
        return rhs, params


  
  class IStartsWith(PatternLookup):
      lookup_name = 'istartswith'
    def process_rhs(self, qn, connection):
        rhs, params = super(IStartsWith, self).process_rhs(qn, connection)
        if params and not self.bilateral_transforms:
            params[0] = "%s%%" % connection.ops.prep_for_like_query(params[0])
        return rhs, params


  default_lookups['istartswith'] = IStartsWith
  
  
  class EndsWith(PatternLookup):
keep keep add 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/lookups.py