mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #11311 -- Reverted [10952], Refs #10785. Changeset [10952] caused problems with m2m relations between models that had non-integer primary keys. Thanks to Ronny for the report and test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11007 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c98a46c2be
commit
b38cf5db5c
3 changed files with 29 additions and 12 deletions
|
@ -136,11 +136,14 @@ Pass
|
|||
# Regression for #10785 -- Custom fields can be used for primary keys.
|
||||
>>> new_bar = Bar.objects.create()
|
||||
>>> new_foo = Foo.objects.create(bar=new_bar)
|
||||
>>> f = Foo.objects.get(bar=new_bar.pk)
|
||||
>>> f == new_foo
|
||||
True
|
||||
>>> f.bar == new_bar
|
||||
True
|
||||
|
||||
# FIXME: This still doesn't work, but will require some changes in
|
||||
# get_db_prep_lookup to fix it.
|
||||
# >>> f = Foo.objects.get(bar=new_bar.pk)
|
||||
# >>> f == new_foo
|
||||
# True
|
||||
# >>> f.bar == new_bar
|
||||
# True
|
||||
|
||||
>>> f = Foo.objects.get(bar=new_bar)
|
||||
>>> f == new_foo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue