[Python-modules-commits] [python-django] 01/03: Imported Upstream version 1.8.13
Raphaël Hertzog
hertzog at moszumanska.debian.org
Wed Jun 8 15:31:41 UTC 2016
This is an automated email from the git hooks/post-receive script.
hertzog pushed a commit to branch debian/jessie-backports
in repository python-django.
commit e689c9e5526e35dfe1fcd948e2813aa19543a95a
Author: Raphaël Hertzog <hertzog at debian.org>
Date: Thu May 12 10:27:28 2016 +0200
Imported Upstream version 1.8.13
---
Django.egg-info/PKG-INFO | 2 +-
Django.egg-info/SOURCES.txt | 1 +
PKG-INFO | 2 +-
django/__init__.py | 2 +-
django/db/backends/base/operations.py | 2 +-
django/db/backends/utils.py | 2 +-
docs/ref/contrib/contenttypes.txt | 2 +-
docs/releases/1.8.13.txt | 16 ++++++++++++++++
docs/releases/index.txt | 1 +
docs/topics/db/aggregation.txt | 13 +++++++------
docs/topics/forms/index.txt | 2 +-
setup.cfg | 2 +-
tests/db_typecasts/tests.py | 3 +++
tests/model_fields/tests.py | 8 ++++++++
tests/template_tests/syntax_tests/test_if.py | 26 ++++++++++++++++++++++++++
15 files changed, 70 insertions(+), 14 deletions(-)
diff --git a/Django.egg-info/PKG-INFO b/Django.egg-info/PKG-INFO
index 389cd94..231f546 100644
--- a/Django.egg-info/PKG-INFO
+++ b/Django.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: Django
-Version: 1.8.12
+Version: 1.8.13
Summary: A high-level Python Web framework that encourages rapid development and clean, pragmatic design.
Home-page: http://www.djangoproject.com/
Author: Django Software Foundation
diff --git a/Django.egg-info/SOURCES.txt b/Django.egg-info/SOURCES.txt
index 7e32870..1bfc127 100644
--- a/Django.egg-info/SOURCES.txt
+++ b/Django.egg-info/SOURCES.txt
@@ -3405,6 +3405,7 @@ docs/releases/1.8.1.txt
docs/releases/1.8.10.txt
docs/releases/1.8.11.txt
docs/releases/1.8.12.txt
+docs/releases/1.8.13.txt
docs/releases/1.8.2.txt
docs/releases/1.8.3.txt
docs/releases/1.8.4.txt
diff --git a/PKG-INFO b/PKG-INFO
index 389cd94..231f546 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: Django
-Version: 1.8.12
+Version: 1.8.13
Summary: A high-level Python Web framework that encourages rapid development and clean, pragmatic design.
Home-page: http://www.djangoproject.com/
Author: Django Software Foundation
diff --git a/django/__init__.py b/django/__init__.py
index bfcda97..1e77d41 100644
--- a/django/__init__.py
+++ b/django/__init__.py
@@ -1,6 +1,6 @@
from django.utils.version import get_version
-VERSION = (1, 8, 12, 'final', 0)
+VERSION = (1, 8, 13, 'final', 0)
__version__ = get_version(VERSION)
diff --git a/django/db/backends/base/operations.py b/django/db/backends/base/operations.py
index 0c9365a..8a8209f 100644
--- a/django/db/backends/base/operations.py
+++ b/django/db/backends/base/operations.py
@@ -481,7 +481,7 @@ class BaseDatabaseOperations(object):
Transforms a string representation of an IP address into the expected
type for the backend driver.
"""
- return value
+ return value or None
def year_lookup_bounds_for_date_field(self, value):
"""
diff --git a/django/db/backends/utils.py b/django/db/backends/utils.py
index 8444454..87a51a4 100644
--- a/django/db/backends/utils.py
+++ b/django/db/backends/utils.py
@@ -125,7 +125,7 @@ def typecast_time(s): # does NOT store time zone information
seconds, microseconds = seconds.split('.')
else:
microseconds = '0'
- return datetime.time(int(hour), int(minutes), int(seconds), int(float('.' + microseconds) * 1000000))
+ return datetime.time(int(hour), int(minutes), int(seconds), int((microseconds + '000000')[:6]))
def typecast_timestamp(s): # does NOT store time zone information
diff --git a/docs/ref/contrib/contenttypes.txt b/docs/ref/contrib/contenttypes.txt
index 298606e..1807d67 100644
--- a/docs/ref/contrib/contenttypes.txt
+++ b/docs/ref/contrib/contenttypes.txt
@@ -417,7 +417,7 @@ Defining :class:`~django.contrib.contenttypes.fields.GenericRelation` with
This enables filtering, ordering, and other query operations on ``Bookmark``
from ``TaggedItem``::
- >>> # Get all tags belonging to books containing `django` in the url
+ >>> # Get all tags belonging to bookmarks containing `django` in the url
>>> TaggedItem.objects.filter(bookmarks__url__contains='django')
[<TaggedItem: django>, <TaggedItem: python>]
diff --git a/docs/releases/1.8.13.txt b/docs/releases/1.8.13.txt
new file mode 100644
index 0000000..3d2e6bf
--- /dev/null
+++ b/docs/releases/1.8.13.txt
@@ -0,0 +1,16 @@
+===========================
+Django 1.8.13 release notes
+===========================
+
+*May 2, 2016*
+
+Django 1.8.13 fixes several bugs in 1.8.12.
+
+Bugfixes
+========
+
+* Fixed ``TimeField`` microseconds round-tripping on MySQL and SQLite
+ (:ticket:`26498`).
+
+* Restored conversion of an empty string to null when saving values of
+ ``GenericIPAddressField`` on SQLite and MySQL (:ticket:`26557`).
diff --git a/docs/releases/index.txt b/docs/releases/index.txt
index c4e4c74..1a40bc4 100644
--- a/docs/releases/index.txt
+++ b/docs/releases/index.txt
@@ -25,6 +25,7 @@ versions of the documentation contain the release notes for any later releases.
.. toctree::
:maxdepth: 1
+ 1.8.13
1.8.12
1.8.11
1.8.10
diff --git a/docs/topics/db/aggregation.txt b/docs/topics/db/aggregation.txt
index f3618e4..cdf7950 100644
--- a/docs/topics/db/aggregation.txt
+++ b/docs/topics/db/aggregation.txt
@@ -194,24 +194,25 @@ results <https://code.djangoproject.com/ticket/10060>`_, as multiple tables are
cross joined. Due to the use of ``LEFT OUTER JOIN``, duplicate records will be
generated if some of the joined tables contain more records than the others:
- >>> Book.objects.first().authors.count()
+ >>> book = Book.objects.first()
+ >>> book.authors.count()
2
- >>> Book.objects.first().chapters.count()
+ >>> book.store_set.count()
3
- >>> q = Book.objects.annotate(Count('authors'), Count('chapters'))
+ >>> q = Book.objects.annotate(Count('authors'), Count('store'))
>>> q[0].authors__count
6
- >>> q[0].chapters__count
+ >>> q[0].store__count
6
For most aggregates, there is no way to avoid this problem, however, the
:class:`~django.db.models.Count` aggregate has a ``distinct`` parameter that
may help:
- >>> q = Book.objects.annotate(Count('authors', distinct=True), Count('chapters', distinct=True))
+ >>> q = Book.objects.annotate(Count('authors', distinct=True), Count('store', distinct=True))
>>> q[0].authors__count
2
- >>> q[0].chapters__count
+ >>> q[0].store__count
3
.. admonition:: If in doubt, inspect the SQL query!
diff --git a/docs/topics/forms/index.txt b/docs/topics/forms/index.txt
index 1a3f8c6..29737b6 100644
--- a/docs/topics/forms/index.txt
+++ b/docs/topics/forms/index.txt
@@ -514,7 +514,7 @@ Here's the output of ``{{ form.as_p }}`` for our ``ContactForm`` instance:
<p><label for="id_subject">Subject:</label>
<input id="id_subject" type="text" name="subject" maxlength="100" /></p>
<p><label for="id_message">Message:</label>
- <input type="text" name="message" id="id_message" /></p>
+ <textarea name="message" id="id_message"></textarea></p>
<p><label for="id_sender">Sender:</label>
<input type="email" name="sender" id="id_sender" /></p>
<p><label for="id_cc_myself">Cc myself:</label>
diff --git a/setup.cfg b/setup.cfg
index 7b39658..fac4f6b 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -21,7 +21,7 @@ license-file = LICENSE
universal = 1
[egg_info]
-tag_date = 0
tag_build =
+tag_date = 0
tag_svn_revision = 0
diff --git a/tests/db_typecasts/tests.py b/tests/db_typecasts/tests.py
index d0e0db2..61dc69e 100644
--- a/tests/db_typecasts/tests.py
+++ b/tests/db_typecasts/tests.py
@@ -27,6 +27,9 @@ TEST_CASES = {
('00:00:12', datetime.time(0, 0, 12)),
('00:00:12.5', datetime.time(0, 0, 12, 500000)),
('7:22:13.312', datetime.time(7, 22, 13, 312000)),
+ ('12:45:30.126631', datetime.time(12, 45, 30, 126631)),
+ ('12:45:30.126630', datetime.time(12, 45, 30, 126630)),
+ ('12:45:30.123456789', datetime.time(12, 45, 30, 123456)),
),
'typecast_timestamp': (
('', None),
diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py
index 2858086..3c1660f 100644
--- a/tests/model_fields/tests.py
+++ b/tests/model_fields/tests.py
@@ -722,6 +722,14 @@ class GenericIPAddressFieldTests(test.TestCase):
o = GenericIPAddress.objects.get()
self.assertIsNone(o.ip)
+ def test_blank_string_saved_as_null(self):
+ o = GenericIPAddress.objects.create(ip='')
+ o.refresh_from_db()
+ self.assertIsNone(o.ip)
+ GenericIPAddress.objects.update(ip='')
+ o.refresh_from_db()
+ self.assertIsNone(o.ip)
+
def test_save_load(self):
instance = GenericIPAddress.objects.create(ip='::1')
loaded = GenericIPAddress.objects.get()
diff --git a/tests/template_tests/syntax_tests/test_if.py b/tests/template_tests/syntax_tests/test_if.py
index 6bbf259..d529cb6 100644
--- a/tests/template_tests/syntax_tests/test_if.py
+++ b/tests/template_tests/syntax_tests/test_if.py
@@ -112,6 +112,32 @@ class IfTagTests(SimpleTestCase):
output = self.engine.render_to_string('if-tag-eq05')
self.assertEqual(output, 'no')
+ # Inequality
+ @setup({'if-tag-noteq01': '{% if foo != bar %}yes{% else %}no{% endif %}'})
+ def test_if_tag_noteq01(self):
+ output = self.engine.render_to_string('if-tag-noteq01')
+ self.assertEqual(output, 'no')
+
+ @setup({'if-tag-noteq02': '{% if foo != bar %}yes{% else %}no{% endif %}'})
+ def test_if_tag_noteq02(self):
+ output = self.engine.render_to_string('if-tag-noteq02', {'foo': 1})
+ self.assertEqual(output, 'yes')
+
+ @setup({'if-tag-noteq03': '{% if foo != bar %}yes{% else %}no{% endif %}'})
+ def test_if_tag_noteq03(self):
+ output = self.engine.render_to_string('if-tag-noteq03', {'foo': 1, 'bar': 1})
+ self.assertEqual(output, 'no')
+
+ @setup({'if-tag-noteq04': '{% if foo != bar %}yes{% else %}no{% endif %}'})
+ def test_if_tag_noteq04(self):
+ output = self.engine.render_to_string('if-tag-noteq04', {'foo': 1, 'bar': 2})
+ self.assertEqual(output, 'yes')
+
+ @setup({'if-tag-noteq05': '{% if foo != "" %}yes{% else %}no{% endif %}'})
+ def test_if_tag_noteq05(self):
+ output = self.engine.render_to_string('if-tag-noteq05')
+ self.assertEqual(output, 'yes')
+
# Comparison
@setup({'if-tag-gt-01': '{% if 2 > 1 %}yes{% else %}no{% endif %}'})
def test_if_tag_gt_01(self):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-django.git
More information about the Python-modules-commits
mailing list