diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2015-10-13 20:25:06 +0200 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-10-21 19:24:19 -0400 |
commit | 0f6d51e6a0a22e37e45c4bf452ddb49723e2f956 (patch) | |
tree | a4076fd02e1fcbbf3774b01e669dc1c8ef741256 /tests/dates/models.py | |
parent | 0dbe897ab5ea055ed53a219f642348d98e1c3cf9 (diff) | |
download | django-0f6d51e6a0a22e37e45c4bf452ddb49723e2f956.tar.gz |
Fixed #25470 -- Avoided unnecessary, expensive DATETIME typecast on MySQL.
Diffstat (limited to 'tests/dates/models.py')
-rw-r--r-- | tests/dates/models.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/dates/models.py b/tests/dates/models.py index 58e6d10d91..2161b2b356 100644 --- a/tests/dates/models.py +++ b/tests/dates/models.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals from django.db import models +from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible @@ -8,6 +9,7 @@ from django.utils.encoding import python_2_unicode_compatible class Article(models.Model): title = models.CharField(max_length=100) pub_date = models.DateField() + pub_datetime = models.DateTimeField(default=timezone.now()) categories = models.ManyToManyField("Category", related_name="articles") |