1
0
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:
Russell Keith-Magee
2014-03-08 11:24:13 +08:00
parent 219d928852
commit 70ec4d776e
5 changed files with 228 additions and 6 deletions

View File

@@ -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')