* cc: timograham@… (added)
* needs_tests: 1 => 0
Comment:
Added a test:
https://github.com/django/django/pull/1246
--
Ticket URL: <https://code.djangoproject.com/ticket/11521#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by akaariai):
As discussed in the pull request the change done to Options.init_name_map
will effectively turn the allow_explicit_fk parameter useless. The change
done is adding field.attname to the name map. The allow_explicit_fk
parameter is used in join generation inside the sql/query.py, and it
allows using attname for lookups when the parameter is set. The parameter
is set for filter() and values() calls at least, but isn't set for some
other operations, like annotate(). I can't see any reason for the
inconsistency - either allow attname everywhere or nowhere.
One test fails if the change to init_name_map and removal of
allow_explicit_fk is done. The failing test is
lookup.tests.LookupTests.test_error_messages, it fails because author_id
is in the error message's "allowed choices" list in addition to author.
But, that is actually correct, author_id is an allowed choice.
Any opposition for making this change at alpha stage? There is a minor
risk this could break something.
The proposed change will also fix this ticket's issue. A patch is
available from: https://github.com/akaariai/django/compare/ticket_11521
--
Ticket URL: <https://code.djangoproject.com/ticket/11521#comment:8>
* stage: Accepted => Ready for checkin
Comment:
We can make this change for 1.7. Patch still applies cleanly and tests
pass.
--
Ticket URL: <https://code.djangoproject.com/ticket/11521#comment:9>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"e01b5a5823fa06a63382f87472978a16c77048d2"]:
{{{
#!CommitTicketReference repository=""
revision="e01b5a5823fa06a63382f87472978a16c77048d2"
Fixed #11521 -- usage of field.attname in .update()
Fixed already by previous patch, only test added.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/11521#comment:10>