mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #25622 -- Accounted for generic relations in the admin to field validation
Thanks to Jonathan Liuti for the report and Tim Graham for the review.
This commit is contained in:
@@ -938,3 +938,14 @@ class ExplicitlyProvidedPK(models.Model):
|
||||
|
||||
class ImplicitlyGeneratedPK(models.Model):
|
||||
name = models.IntegerField(unique=True)
|
||||
|
||||
|
||||
# Models for #25622
|
||||
class ReferencedByGenRel(models.Model):
|
||||
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
|
||||
object_id = models.PositiveIntegerField()
|
||||
content_object = GenericForeignKey('content_type', 'object_id')
|
||||
|
||||
|
||||
class GenRelReference(models.Model):
|
||||
references = GenericRelation(ReferencedByGenRel)
|
||||
|
||||
Reference in New Issue
Block a user