mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #31181 -- Added links to related models for admin's readonly fields.
This commit is contained in:
committed by
Mariusz Felisiak
parent
855fc06236
commit
b790883065
@@ -365,6 +365,9 @@ class Language(models.Model):
|
||||
english_name = models.CharField(max_length=50)
|
||||
shortlist = models.BooleanField(default=False)
|
||||
|
||||
def __str__(self):
|
||||
return self.iso
|
||||
|
||||
class Meta:
|
||||
ordering = ('iso',)
|
||||
|
||||
@@ -999,3 +1002,9 @@ class UserProxy(User):
|
||||
"""Proxy a model with a different app_label."""
|
||||
class Meta:
|
||||
proxy = True
|
||||
|
||||
|
||||
class ReadOnlyRelatedField(models.Model):
|
||||
chapter = models.ForeignKey(Chapter, models.CASCADE)
|
||||
language = models.ForeignKey(Language, models.CASCADE)
|
||||
user = models.ForeignKey(User, models.CASCADE)
|
||||
|
||||
Reference in New Issue
Block a user