Ticket #5223: sqlite_year_lookup_fix.diff
File sqlite_year_lookup_fix.diff, 752 bytes (added by , 17 years ago) |
---|
-
models/fields/__init__.py
507 507 value = value.strftime('%Y-%m-%d') 508 508 else: 509 509 value = smart_unicode(value) 510 if lookup_type == 'year' and settings.DATABASE_ENGINE == 'sqlite3': 511 try: 512 value = int(value) 513 except ValueError: 514 raise ValueError("The __year lookup type requires an integer argument") 515 return ['%s-01-01' % value, '%s-12-31' % value] 510 516 return Field.get_db_prep_lookup(self, lookup_type, value) 511 517 512 518 def pre_save(self, model_instance, add):