summaryrefslogtreecommitdiff
path: root/tests/dates/models.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2015-10-13 20:25:06 +0200
committerTim Graham <timograham@gmail.com>2015-10-21 19:24:19 -0400
commit0f6d51e6a0a22e37e45c4bf452ddb49723e2f956 (patch)
treea4076fd02e1fcbbf3774b01e669dc1c8ef741256 /tests/dates/models.py
parent0dbe897ab5ea055ed53a219f642348d98e1c3cf9 (diff)
downloaddjango-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.py2
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")