I attached tests.
--
Ticket URL: <https://code.djangoproject.com/ticket/32321>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "tests_32321.diff" added.
Tests.
Comment (by Hasan Ramezani):
Mariusz,
When I try to run the
[https://code.djangoproject.com/timeline?from=2021-01-05T00%3A49%3A56-06%3A00&precision=second
tests] that you added to the ticket, I get
`ValueError('Index.fields must be a list or tuple.')`
it means currently, `models.Index` doesn't support `models.F('height') /
(models.F('weight__abs') + models.Value(5))` and
`Lower('missing_field').desc()` as index `fields`.
Should we add support for these kinds of fields to `models.Index`?
--
Ticket URL: <https://code.djangoproject.com/ticket/32321#comment:1>
* stage: Accepted => Someday/Maybe
Old description:
> The current system checks don't cover invalid models fields in functional
> indexes. This is not straightforward because resolving expressions with
> non-existent throws `FieldError`, so we cannot just collect columns from
> `Query._gen_cols()`.
>
> I attached tests.
New description:
The current system checks don't cover invalid models fields in functional
indexes. This is not straightforward because resolving expressions with
non-existent throws `FieldError`, so we cannot just collect columns from
`Query._gen_cols()`.
Follow up to #26167.
I attached tests.
--
Comment:
Sorry Hasan, I should mark this ticket as "someday", it's a follow up to
#26167. It will be valid after merging
[https://github.com/django/django/pull/11929 PR].
--
Ticket URL: <https://code.djangoproject.com/ticket/32321#comment:2>
* stage: Someday/Maybe => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/32321#comment:3>
* owner: nobody => Hasan Ramezani
* status: new => assigned
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/13886 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/32321#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"f75037731800b7206759768dcdf2fed9e3e3d4ab" f750377]:
{{{
#!CommitTicketReference repository=""
revision="f75037731800b7206759768dcdf2fed9e3e3d4ab"
Fixed #32321 -- Added system checks for invalid model field names in
functional indexes.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32321#comment:5>