Loading docs/releases/1.8.2.txt +5 −0 Original line number Diff line number Diff line Loading @@ -20,3 +20,8 @@ Bugfixes * Fixed incorrect GROUP BY clause generation on MySQL when the query's model has a self-referential foreign key (:ticket:`24748`). * Implemented ``ForeignKey.get_db_prep_value()`` so that ``ForeignKey``\s pointing to :class:`~django.db.models.UUIDField` and inheritance on models with ``UUIDField`` primary keys work correctly (:ticket:`24698`, :ticket:`24712`). tests/model_fields/models.py +8 −0 Original line number Diff line number Diff line Loading @@ -373,3 +373,11 @@ class PrimaryKeyUUIDModel(models.Model): class RelatedToUUIDModel(models.Model): uuid_fk = models.ForeignKey('PrimaryKeyUUIDModel') class UUIDChild(PrimaryKeyUUIDModel): pass class UUIDGrandchild(UUIDChild): pass tests/model_fields/test_uuid.py +6 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,8 @@ from django.db import models from django.test import TestCase from .models import ( NullableUUIDModel, PrimaryKeyUUIDModel, RelatedToUUIDModel, UUIDModel, NullableUUIDModel, PrimaryKeyUUIDModel, RelatedToUUIDModel, UUIDGrandchild, UUIDModel, ) Loading Loading @@ -146,3 +147,7 @@ class TestAsPrimaryKey(TestCase): RelatedToUUIDModel.objects.update(uuid_fk=u2.pk) r.refresh_from_db() self.assertEqual(r.uuid_fk, u2) def test_two_level_foreign_keys(self): # exercises ForeignKey.get_db_prep_value() UUIDGrandchild().save() Loading
docs/releases/1.8.2.txt +5 −0 Original line number Diff line number Diff line Loading @@ -20,3 +20,8 @@ Bugfixes * Fixed incorrect GROUP BY clause generation on MySQL when the query's model has a self-referential foreign key (:ticket:`24748`). * Implemented ``ForeignKey.get_db_prep_value()`` so that ``ForeignKey``\s pointing to :class:`~django.db.models.UUIDField` and inheritance on models with ``UUIDField`` primary keys work correctly (:ticket:`24698`, :ticket:`24712`).
tests/model_fields/models.py +8 −0 Original line number Diff line number Diff line Loading @@ -373,3 +373,11 @@ class PrimaryKeyUUIDModel(models.Model): class RelatedToUUIDModel(models.Model): uuid_fk = models.ForeignKey('PrimaryKeyUUIDModel') class UUIDChild(PrimaryKeyUUIDModel): pass class UUIDGrandchild(UUIDChild): pass
tests/model_fields/test_uuid.py +6 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,8 @@ from django.db import models from django.test import TestCase from .models import ( NullableUUIDModel, PrimaryKeyUUIDModel, RelatedToUUIDModel, UUIDModel, NullableUUIDModel, PrimaryKeyUUIDModel, RelatedToUUIDModel, UUIDGrandchild, UUIDModel, ) Loading Loading @@ -146,3 +147,7 @@ class TestAsPrimaryKey(TestCase): RelatedToUUIDModel.objects.update(uuid_fk=u2.pk) r.refresh_from_db() self.assertEqual(r.uuid_fk, u2) def test_two_level_foreign_keys(self): # exercises ForeignKey.get_db_prep_value() UUIDGrandchild().save()