forked from avidal/django-pyodbc
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue 49, special-case dtime fields with value set to midnight …
…when handling SQL Server date/time compatibility.
- Loading branch information
cramm0
committed
Apr 21, 2009
1 parent
83dacc9
commit 8759b66
Showing
4 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
from django.db import models | ||
|
||
class Event(models.Model): | ||
start = models.ForeignKey('TimeRepresentation') | ||
|
||
class TimeRepresentation(models.Model): | ||
hora = models.TimeField(null=True) | ||
|
||
__test__ = {'API_TESTS': """ | ||
>>> from datetime import time | ||
>>> t = TimeRepresentation.objects.create(hora=time(0, 0)) | ||
>>> ev = Event.objects.create(start=t) | ||
# If we access without select_related, it works fine | ||
>>> evs1 = Event.objects.all() | ||
>>> evs1[0].start.hora | ||
datetime.time(0, 0) | ||
# If we access with select_related, it works too | ||
>>> evs2 = Event.objects.all().select_related('start') | ||
>>> evs2[0].start.hora | ||
datetime.time(0, 0) | ||
"""} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,7 @@ | |
'issue019', | ||
'issue028', | ||
'issue031', | ||
'issue049', | ||
'basic', | ||
'order_with_respect_to', | ||
'fixtures', | ||
|