mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #22034 -- Added a specific set of relation checks for GenericInlineModelAdmin.
Thanks to jwa for the report.
This commit is contained in:
@@ -4,7 +4,8 @@ Tests of ModelAdmin system checks logic.
|
||||
|
||||
from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
|
||||
class Album(models.Model):
|
||||
title = models.CharField(max_length=150)
|
||||
@@ -55,3 +56,11 @@ class State(models.Model):
|
||||
|
||||
class City(models.Model):
|
||||
state = models.ForeignKey(State)
|
||||
|
||||
|
||||
class Influence(models.Model):
|
||||
name = models.TextField()
|
||||
|
||||
content_type = models.ForeignKey(ContentType)
|
||||
object_id = models.PositiveIntegerField()
|
||||
content_object = GenericForeignKey('content_type', 'object_id')
|
||||
|
||||
Reference in New Issue
Block a user