#11319: ForeignKey filters use the wrong field to prepare values for database ---------------------------------------------------+------------------------ Reporter: russellm | Owner: carljm Status: new | Milestone: 1.3 Component: Database layer (models, ORM) | Version: 1.0 Resolution: | Keywords: Stage: Accepted | Has_patch: 1 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 1 | ---------------------------------------------------+------------------------ Changes (by carljm):
* needs_better_patch: 0 => 1 * has_patch: 0 => 1 Comment: As best I can tell (based on being able to uncomment the commented test in custom_pk and have it pass) case (1) from the description here has already been fixed sometime in the past two years, leaving just case (2) -- to_field. I've added tests for various queries (some currently-broken, one currently-working) involving an FK with to_field, and my github branch linked above now fixes all of the broken cases, and the full test suite passes under Postgres and SQLite (queries tests pass under MySQL, InnoDB and MyISAM). That branch also fixes the cascade-deletion symptom in #15121, which I closed as duplicate of this. I won't claim certainty that the fixes in that branch are the ideal fixes for this, and am not ready to commit this without some other ORM- experienced eyes on it first. But -- all tests pass, and that's at least a useful starting point. -- Ticket URL: <http://code.djangoproject.com/ticket/11319#comment:13> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.