Loading AUTHORS +1 −0 Original line number Diff line number Diff line Loading @@ -442,6 +442,7 @@ answer newbie questions, and generally made Django that much better: Gopal Narayanan <gopastro@gmail.com> Fraser Nevett <mail@nevett.org> Sam Newman <http://www.magpiebrain.com/> Alasdair Nicol <http://al.sdair.co.uk/> Ryan Niemeyer <https://profiles.google.com/ryan.niemeyer/about> Filip Noetzel <http://filip.noetzel.co.uk/> Afonso Fernández Nogueira <fonzzo.django@gmail.com> Loading django/contrib/gis/tests/geoapp/models.py +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ class Track(models.Model): def __str__(self): return self.name class Truth(models.Model): val = models.BooleanField() val = models.BooleanField(default=False) objects = models.GeoManager() if not spatialite: Loading django/core/checks/compatibility/django_1_6_0.py +28 −1 Original line number Diff line number Diff line from __future__ import unicode_literals from django.db import models def check_test_runner(): """ Loading @@ -24,6 +25,31 @@ def check_test_runner(): ] return ' '.join(message) def check_boolean_field_default_value(): """ Checks if there are any BooleanFields without a default value, & warns the user that the default has changed from False to Null. """ fields = [] for cls in models.get_models(): opts = cls._meta for f in opts.local_fields: if isinstance(f, models.BooleanField) and not f.has_default(): fields.append( '%s.%s: "%s"' % (opts.app_label, opts.object_name, f.name) ) if fields: fieldnames = ", ".join(fields) message = [ "You have not set a default value for one or more BooleanFields:", "%s." % fieldnames, "In Django 1.6 the default value of BooleanField was changed from", "False to Null when Field.default isn't defined. See", "https://docs.djangoproject.com/en/1.6/ref/models/fields/#booleanfield" "for more information." ] return ' '.join(message) def run_checks(): """ Loading @@ -31,7 +57,8 @@ def run_checks(): messages from all the relevant check functions for this version of Django. """ checks = [ check_test_runner() check_test_runner(), check_boolean_field_default_value(), ] # Filter out the ``None`` or empty strings. return [output for output in checks if output] tests/admin_views/models.py +4 −4 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ class ModelWithStringPrimaryKey(models.Model): @python_2_unicode_compatible class Color(models.Model): value = models.CharField(max_length=10) warm = models.BooleanField() warm = models.BooleanField(default=False) def __str__(self): return self.value Loading Loading @@ -144,7 +144,7 @@ class Actor(models.Model): @python_2_unicode_compatible class Inquisition(models.Model): expected = models.BooleanField() expected = models.BooleanField(default=False) leader = models.ForeignKey(Actor) country = models.CharField(max_length=20) Loading Loading @@ -376,7 +376,7 @@ class Link(models.Model): class PrePopulatedPost(models.Model): title = models.CharField(max_length=100) published = models.BooleanField() published = models.BooleanField(default=False) slug = models.SlugField() Loading Loading @@ -607,7 +607,7 @@ class PrePopulatedPostLargeSlug(models.Model): the javascript (ie, using THOUSAND_SEPARATOR ends up with maxLength=1,000) """ title = models.CharField(max_length=100) published = models.BooleanField() published = models.BooleanField(default=False) slug = models.SlugField(max_length=1000) class AdminOrderedField(models.Model): Loading tests/aggregation_regress/models.py +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ class Store(models.Model): class Entries(models.Model): EntryID = models.AutoField(primary_key=True, db_column='Entry ID') Entry = models.CharField(unique=True, max_length=50) Exclude = models.BooleanField() Exclude = models.BooleanField(default=False) class Clues(models.Model): Loading Loading
AUTHORS +1 −0 Original line number Diff line number Diff line Loading @@ -442,6 +442,7 @@ answer newbie questions, and generally made Django that much better: Gopal Narayanan <gopastro@gmail.com> Fraser Nevett <mail@nevett.org> Sam Newman <http://www.magpiebrain.com/> Alasdair Nicol <http://al.sdair.co.uk/> Ryan Niemeyer <https://profiles.google.com/ryan.niemeyer/about> Filip Noetzel <http://filip.noetzel.co.uk/> Afonso Fernández Nogueira <fonzzo.django@gmail.com> Loading
django/contrib/gis/tests/geoapp/models.py +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ class Track(models.Model): def __str__(self): return self.name class Truth(models.Model): val = models.BooleanField() val = models.BooleanField(default=False) objects = models.GeoManager() if not spatialite: Loading
django/core/checks/compatibility/django_1_6_0.py +28 −1 Original line number Diff line number Diff line from __future__ import unicode_literals from django.db import models def check_test_runner(): """ Loading @@ -24,6 +25,31 @@ def check_test_runner(): ] return ' '.join(message) def check_boolean_field_default_value(): """ Checks if there are any BooleanFields without a default value, & warns the user that the default has changed from False to Null. """ fields = [] for cls in models.get_models(): opts = cls._meta for f in opts.local_fields: if isinstance(f, models.BooleanField) and not f.has_default(): fields.append( '%s.%s: "%s"' % (opts.app_label, opts.object_name, f.name) ) if fields: fieldnames = ", ".join(fields) message = [ "You have not set a default value for one or more BooleanFields:", "%s." % fieldnames, "In Django 1.6 the default value of BooleanField was changed from", "False to Null when Field.default isn't defined. See", "https://docs.djangoproject.com/en/1.6/ref/models/fields/#booleanfield" "for more information." ] return ' '.join(message) def run_checks(): """ Loading @@ -31,7 +57,8 @@ def run_checks(): messages from all the relevant check functions for this version of Django. """ checks = [ check_test_runner() check_test_runner(), check_boolean_field_default_value(), ] # Filter out the ``None`` or empty strings. return [output for output in checks if output]
tests/admin_views/models.py +4 −4 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ class ModelWithStringPrimaryKey(models.Model): @python_2_unicode_compatible class Color(models.Model): value = models.CharField(max_length=10) warm = models.BooleanField() warm = models.BooleanField(default=False) def __str__(self): return self.value Loading Loading @@ -144,7 +144,7 @@ class Actor(models.Model): @python_2_unicode_compatible class Inquisition(models.Model): expected = models.BooleanField() expected = models.BooleanField(default=False) leader = models.ForeignKey(Actor) country = models.CharField(max_length=20) Loading Loading @@ -376,7 +376,7 @@ class Link(models.Model): class PrePopulatedPost(models.Model): title = models.CharField(max_length=100) published = models.BooleanField() published = models.BooleanField(default=False) slug = models.SlugField() Loading Loading @@ -607,7 +607,7 @@ class PrePopulatedPostLargeSlug(models.Model): the javascript (ie, using THOUSAND_SEPARATOR ends up with maxLength=1,000) """ title = models.CharField(max_length=100) published = models.BooleanField() published = models.BooleanField(default=False) slug = models.SlugField(max_length=1000) class AdminOrderedField(models.Model): Loading
tests/aggregation_regress/models.py +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ class Store(models.Model): class Entries(models.Model): EntryID = models.AutoField(primary_key=True, db_column='Entry ID') Entry = models.CharField(unique=True, max_length=50) Exclude = models.BooleanField() Exclude = models.BooleanField(default=False) class Clues(models.Model): Loading