1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #13941 -- Corrected the way sequence names are reset under Postgres, especially when generic foreign keys are involved. Thanks to Ales Zoulek for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13449 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-07-30 02:42:36 +00:00
parent cd8758ef4d
commit bab9aab9a2
3 changed files with 34 additions and 2 deletions

View File

@@ -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,19 @@ 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)
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')
qn = connection.ops.quote_name
__test__ = {'API_TESTS': """