Ticket #3689: sqlite2.diff
File sqlite2.diff, 2.1 KB (added by , 17 years ago) |
---|
-
django/db/models/fields/__init__.py
219 219 value = int(value) 220 220 except ValueError: 221 221 raise ValueError("The __year lookup type requires an integer argument") 222 return ['%s-01-01 00:00:00' % value, '%s-12-31 23:59:59.999999' % value]222 return ['%s-01-01' % value, '%s-1-1' % (value + 1)] 223 223 raise TypeError("Field has invalid lookup: %s" % lookup_type) 224 224 225 225 def has_default(self): -
django/db/backends/sqlite3/base.py
233 233 'istartswith': "LIKE %s ESCAPE '\\'", 234 234 'iendswith': "LIKE %s ESCAPE '\\'", 235 235 } 236 -
tests/regressiontests/datatypes/models.py
56 56 datetime.time(5, 30) 57 57 >>> d3.consumed_at 58 58 datetime.datetime(2007, 4, 20, 16, 19, 59) 59 60 # SQLite date bug -- ref #3689 61 # cleanup 62 >>> d.delete() 63 >>> d2.delete() 64 >>> d3.delete() 65 66 >>> d = Donut(name='Date Test 2007', baked_date=datetime.datetime(year=2007, month=12, day=31), consumed_at=datetime.datetime(year=2007, month=12, day=31, hour=23, minute=59, second=59)) 67 >>> d.save() 68 >>> d1 = Donut(name='Date Test 2006', baked_date=datetime.datetime(year=2006, month=1, day=1), consumed_at=datetime.datetime(year=2006, month=1, day=1)) 69 >>> d1.save() 70 71 >>> Donut.objects.get(baked_date__year=2007) 72 <Donut: Date Test 2007> 73 74 >>> Donut.objects.get(baked_date__year=2006) 75 <Donut: Date Test 2006> 76 77 >>> Donut.objects.get(consumed_at__year=2007) 78 <Donut: Date Test 2007> 79 80 >>> Donut.objects.get(consumed_at__year=2006) 81 <Donut: Date Test 2006> 82 83 >>> d.delete() 84 >>> d1.delete() 59 85 """}