mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #26060 -- Fixed crash with reverse OneToOneField in ModelAdmin.readonly_fields.
This commit is contained in:
parent
fb4272f0e6
commit
9a33d3d764
6 changed files with 87 additions and 13 deletions
|
@ -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! """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue