Ticket #1148: year-alternative.diff

File year-alternative.diff, 591 bytes (added by hugo, 19 years ago)

alternative patch for same problem

  • core/meta/fields.py

     
    180180        elif lookup_type in ('range', 'in'):
    181181            return value
    182182        elif lookup_type == 'year':
    183             return ['%s-01-01' % value, '%s-12-31' % value]
     183            return ['%s-01-01' % value, '%04d-01-01' % (int(value)+1)]
    184184        elif lookup_type in ('contains', 'icontains'):
    185185            return ["%%%s%%" % prep_for_like_query(value)]
    186186        elif lookup_type == 'iexact':
Back to Top