mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #10109 -- Removed the use of raw SQL in many-to-many fields by introducing an autogenerated through model.
This is the first part of Alex Gaynor's GSoC project to add Multi-db support to Django. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11710 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
aba5389326
commit
585b7acaa3
20 changed files with 457 additions and 244 deletions
|
@ -133,7 +133,7 @@ AttributeError: 'ManyRelatedManager' object has no attribute 'add'
|
|||
>>> rock.members.create(name='Anne')
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
AttributeError: Cannot use create() on a ManyToManyField which specifies an intermediary model. Use Membership's Manager instead.
|
||||
AttributeError: Cannot use create() on a ManyToManyField which specifies an intermediary model. Use m2m_through.Membership's Manager instead.
|
||||
|
||||
# Remove has similar complications, and is not provided either.
|
||||
>>> rock.members.remove(jim)
|
||||
|
@ -160,7 +160,7 @@ AttributeError: 'ManyRelatedManager' object has no attribute 'remove'
|
|||
>>> rock.members = backup
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
AttributeError: Cannot set values on a ManyToManyField which specifies an intermediary model. Use Membership's Manager instead.
|
||||
AttributeError: Cannot set values on a ManyToManyField which specifies an intermediary model. Use m2m_through.Membership's Manager instead.
|
||||
|
||||
# Let's re-save those instances that we've cleared.
|
||||
>>> m1.save()
|
||||
|
@ -184,7 +184,7 @@ AttributeError: 'ManyRelatedManager' object has no attribute 'add'
|
|||
>>> bob.group_set.create(name='Funk')
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
AttributeError: Cannot use create() on a ManyToManyField which specifies an intermediary model. Use Membership's Manager instead.
|
||||
AttributeError: Cannot use create() on a ManyToManyField which specifies an intermediary model. Use m2m_through.Membership's Manager instead.
|
||||
|
||||
# Remove has similar complications, and is not provided either.
|
||||
>>> jim.group_set.remove(rock)
|
||||
|
@ -209,7 +209,7 @@ AttributeError: 'ManyRelatedManager' object has no attribute 'remove'
|
|||
>>> jim.group_set = backup
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
AttributeError: Cannot set values on a ManyToManyField which specifies an intermediary model. Use Membership's Manager instead.
|
||||
AttributeError: Cannot set values on a ManyToManyField which specifies an intermediary model. Use m2m_through.Membership's Manager instead.
|
||||
|
||||
# Let's re-save those instances that we've cleared.
|
||||
>>> m1.save()
|
||||
|
@ -334,4 +334,4 @@ AttributeError: Cannot set values on a ManyToManyField which specifies an interm
|
|||
# QuerySet's distinct() method can correct this problem.
|
||||
>>> Person.objects.filter(membership__date_joined__gt=datetime(2004, 1, 1)).distinct()
|
||||
[<Person: Jane>, <Person: Jim>]
|
||||
"""}
|
||||
"""}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue