1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

[1.5.x] Fixed #15040 - Boolean fields return 0 and 1 when loaded through select_related

Thanks to homm for the report and ramiro for the patch.

Backport of f3a2bcdee9 from master
This commit is contained in:
Luke Plant
2012-10-26 00:25:59 +01:00
parent 84849723ad
commit 142f69eb8c
3 changed files with 55 additions and 2 deletions

View File

@@ -66,6 +66,11 @@ class BooleanModel(models.Model):
bfield = models.BooleanField()
string = models.CharField(max_length=10, default='abc')
class FksToBooleans(models.Model):
"""Model wih FKs to models with {Null,}BooleanField's, #15040"""
bf = models.ForeignKey(BooleanModel)
nbf = models.ForeignKey(NullBooleanModel)
class RenamedField(models.Model):
modelname = models.IntegerField(name="fieldname", choices=((1,'One'),))