Virtual foreign relation can have unique set up to enable model-instance
cache. I attach a patch and a test.
--
Ticket URL: <https://code.djangoproject.com/ticket/22514>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:1>
* owner: nobody => vzima
* status: new => assigned
* has_patch: 0 => 1
* stage: Accepted => Ready for checkin
Comment:
I've made a PR from the patch.
PR: https://github.com/django/django/pull/2687
This patch only patches up the postgres issue. It might be worth to not
generate indexes on virtual fields in general.
--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:2>
Comment (by timo):
In the future, please do not mark your own patch as "Ready for checkin".
You need to get a second set of eyes to review the patch and then that
person can do that. While I don't object to fixing this and am looking at
it, note the following deprecation for 2.0: "The DatabaseCreation class on
each database backend will be removed, and all table/schema editing will
be moved to be via SchemaEditor instead." I guess you may want to see if
this issue exists there as well.
--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:3>
* stage: Ready for checkin => Accepted
Comment:
Sorry, I mixed it up with "Ready for code review".
I've run into this issue in 1.6. There is a chance this bug lives on
multiple places, but I'd be happier if somebody more familiar with the ORM
core check it out.
--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"78c32f1caa9cb9b28be2d867aff586a2016122ed"]:
{{{
#!CommitTicketReference repository=""
revision="78c32f1caa9cb9b28be2d867aff586a2016122ed"
Fixed #22514 -- Prevented indexes on virtual fields [postgres].
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:5>
Comment (by vzima):
Is there any chance for a backport to 1.6? That version is also affected.
--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:6>
Comment (by timo):
Not unless it's a regression from 1.5.
--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"6e5a7367524d3e3abd3d0f60f2e8a41796908101"]:
{{{
#!CommitTicketReference repository=""
revision="6e5a7367524d3e3abd3d0f60f2e8a41796908101"
[1.7.x] Fixed #22514 -- Prevented indexes on virtual fields [postgres].
Backport of 78c32f1caa from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:8>
Comment (by vzima):
Found it. It is a regression from 1.5. This is the commit which introduced
the bug:
https://github.com/django/django/commit/c698c55966ed9179828857398d27bf69e64713a2
--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:9>
Comment (by Tim Graham <timograham@…>):
In [changeset:"1892ced10a8c0a74a93acddecdb3329fc58a017b"]:
{{{
#!CommitTicketReference repository=""
revision="1892ced10a8c0a74a93acddecdb3329fc58a017b"
Added refs #22514 to 1.6.6 release notes.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:10>
Comment (by Tim Graham <timograham@…>):
In [changeset:"d107c7bd7db183d85bb3b22e0019b3be8af262d2"]:
{{{
#!CommitTicketReference repository=""
revision="d107c7bd7db183d85bb3b22e0019b3be8af262d2"
[1.7.x] Added refs #22514 to 1.6.6 release notes.
Backport of 1892ced10a from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:12>
Comment (by Tim Graham <timograham@…>):
In [changeset:"ef3ae3d1c94ac1d4ffaeeeec1ee544e91431e65b"]:
{{{
#!CommitTicketReference repository=""
revision="ef3ae3d1c94ac1d4ffaeeeec1ee544e91431e65b"
[1.6.x] Fixed #22514 -- Prevented indexes on virtual fields [postgres].
Backport of 78c32f1caa from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:11>