Fixed #26060 -- Fixed crash with reverse OneToOneField in ModelAdmin.readonly_fields.

This commit is contained in:
Alexander Gaevsky 2016-01-09 22:15:21 +02:00 committed by Tim Graham
parent fb4272f0e6
commit 9a33d3d764
6 changed files with 87 additions and 13 deletions

View file

@ -538,12 +538,17 @@ class Plot(models.Model):
@python_2_unicode_compatible
class PlotDetails(models.Model):
details = models.CharField(max_length=100)
plot = models.OneToOneField(Plot, models.CASCADE)
plot = models.OneToOneField(Plot, models.CASCADE, null=True, blank=True)
def __str__(self):
return self.details
class PlotProxy(Plot):
class Meta:
proxy = True
@python_2_unicode_compatible
class SecretHideout(models.Model):
""" Secret! Not registered with the admin! """