Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
Added field to test model to cause failure on PostgreSQL
Browse files Browse the repository at this point in the history
Create a test that illustrates django#12728.

This is a bug that manifests when there's a generic relation to
a model that uses multi-table inheritence, with PostgreSQL as the
back-end.
  • Loading branch information
Lorin Hochstein committed Jul 31, 2012
1 parent 0f69a16 commit 41c0a33
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/regressiontests/backends/models.py
@@ -1,3 +1,4 @@
from django.contrib.comments.models import Comment
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models, connection
Expand Down Expand Up @@ -44,10 +45,15 @@ class Tag(models.Model):
content_object = generic.GenericForeignKey('content_type', 'object_id')


class PossibleSelfComment(Comment):
by_author = models.BooleanField(default=False)


class Post(models.Model):
name = models.CharField(max_length=30)
text = models.TextField()
tags = generic.GenericRelation('Tag')
comments = generic.GenericRelation('PossibleSelfComment')

class Meta:
db_table = 'CaseSensitive_Post'
Expand Down

0 comments on commit 41c0a33

Please sign in to comment.