summaryrefslogtreecommitdiff
path: root/tests/regressiontests/backends/models.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2010-08-09 21:22:37 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2010-08-09 21:22:37 +0000
commit6001ba016a3db4701d56abc6d30868d4e5d88dbf (patch)
tree7a42c57d802484300c2384d3cd3a968de1804383 /tests/regressiontests/backends/models.py
parentc7bd48cb9f645e5ff07d1e68b86130e3bb2b043f (diff)
downloaddjango-soc2010/query-refactor.tar.gz
[soc2010/query-refactor] Merged up to trunk r13556, resolved merge conflictsarchive/soc2010/query-refactorsoc2010/query-refactor
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/query-refactor@13565 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/backends/models.py')
-rw-r--r--tests/regressiontests/backends/models.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/regressiontests/backends/models.py b/tests/regressiontests/backends/models.py
index e3137f2710..7315408d49 100644
--- a/tests/regressiontests/backends/models.py
+++ b/tests/regressiontests/backends/models.py
@@ -1,3 +1,5 @@
+from django.contrib.contenttypes import generic
+from django.contrib.contenttypes.models import ContentType
from django.conf import settings
from django.db import models
from django.db import connection, DEFAULT_DB_ALIAS
@@ -37,6 +39,21 @@ if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'] != 'django.db.backends.mysql':
m2m_also_quite_long_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz = models.ManyToManyField(Person,blank=True)
+class Tag(models.Model):
+ name = models.CharField(max_length=30)
+ content_type = models.ForeignKey(ContentType, related_name='backend_tags')
+ object_id = models.PositiveIntegerField()
+ content_object = generic.GenericForeignKey('content_type', 'object_id')
+
+
+class Post(models.Model):
+ name = models.CharField(max_length=30)
+ text = models.TextField()
+ tags = generic.GenericRelation('Tag')
+
+ class Meta:
+ db_table = 'CaseSensitive_Post'
+
qn = connection.ops.quote_name
__test__ = {'API_TESTS': """