Django

Code

Show
Ignore:
Timestamp:
07/11/08 04:00:35 (6 months ago)
Author:
mtredinnick
Message:

Fixed #7448 -- Convert "in" filters to pass in the correct values for datetimes
and similar complex objects.

Based on patches from cgrady and alexkosholev. Refs #7707.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/db/models/fields/__init__.py

    r7882 r7883  
    555555 
    556556    def get_db_prep_lookup(self, lookup_type, value): 
    557         if lookup_type == 'range'
     557        if lookup_type in ('range', 'in')
    558558            value = [smart_unicode(v) for v in value] 
    559559        elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte') and hasattr(value, 'strftime'): 
     
    642642 
    643643    def get_db_prep_lookup(self, lookup_type, value): 
    644         if lookup_type == 'range'
     644        if lookup_type in ('range', 'in')
    645645            value = [smart_unicode(v) for v in value] 
    646646        else: 
     
    721721 
    722722    def get_db_prep_lookup(self, lookup_type, value): 
    723         if lookup_type == 'range'
     723        if lookup_type in ('range', 'in')
    724724            value = [self._format(v) for v in value] 
    725725        else: 
     
    10981098        else: 
    10991099            prep = smart_unicode 
    1100         if lookup_type == 'range'
     1100        if lookup_type in ('range', 'in')
    11011101            value = [prep(v) for v in value] 
    11021102        else: