[Django] #36669: Document `Negative indexing is not supported` for slicing F() expressions

7 views
Skip to first unread message

Django

unread,
Oct 16, 2025, 2:51:28 PM10/16/25
to django-...@googlegroups.com
#36669: Document `Negative indexing is not supported` for slicing F() expressions
-------------------------------------+-------------------------------------
Reporter: AJ Collins | Type:
| Cleanup/optimization
Status: new | Component:
| Documentation
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
I was planning to use F() expression slicing to take off the last
character of a field. I was met with `ValueError: Negative indexing is not
supported.`

I'd like to update the docs for
https://docs.djangoproject.com/en/6.0/ref/models/expressions/#slicing-f-expressions

I have a PR ready to go as well
--
Ticket URL: <https://code.djangoproject.com/ticket/36669>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 16, 2025, 3:00:15 PM10/16/25
to django-...@googlegroups.com
#36669: Document `Negative indexing is not supported` for slicing F() expressions
-------------------------------------+-------------------------------------
Reporter: AJ Collins | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by AJ Collins:

Old description:

> I was planning to use F() expression slicing to take off the last
> character of a field. I was met with `ValueError: Negative indexing is
> not supported.`
>
> I'd like to update the docs for
> https://docs.djangoproject.com/en/6.0/ref/models/expressions/#slicing-f-expressions
>
> I have a PR ready to go as well

New description:

I was planning to use F() expression slicing to take off the last
character of a field. I was met with `ValueError: Negative indexing is not
supported.`

I'd like to update the docs for
https://docs.djangoproject.com/en/6.0/ref/models/expressions/#slicing-f-expressions

https://github.com/django/django/pull/19969

--
--
Ticket URL: <https://code.djangoproject.com/ticket/36669#comment:1>

Django

unread,
Oct 16, 2025, 3:06:49 PM10/16/25
to django-...@googlegroups.com
#36669: Document `Negative indexing is not supported` for slicing F() expressions
-------------------------------------+-------------------------------------
Reporter: AJ Collins | Owner: AJ
Type: | Collins
Cleanup/optimization | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* owner: (none) => AJ Collins
* stage: Unreviewed => Ready for checkin
* status: new => assigned
* version: 5.2 => dev

--
Ticket URL: <https://code.djangoproject.com/ticket/36669#comment:2>

Django

unread,
Oct 17, 2025, 10:20:35 AM10/17/25
to django-...@googlegroups.com
#36669: Document `Negative indexing is not supported` for slicing F() expressions
-------------------------------------+-------------------------------------
Reporter: AJ Collins | Owner: AJ
Type: | Collins
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"f715bc8990b5b8a1df948c2b71e8edbdda47e7db" f715bc8]:
{{{#!CommitTicketReference repository=""
revision="f715bc8990b5b8a1df948c2b71e8edbdda47e7db"
Fixed #36669 -- Doc'd that negative indexes are not supported in F()
slices.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36669#comment:3>

Django

unread,
Oct 17, 2025, 10:22:28 AM10/17/25
to django-...@googlegroups.com
#36669: Document `Negative indexing is not supported` for slicing F() expressions
-------------------------------------+-------------------------------------
Reporter: AJ Collins | Owner: AJ
Type: | Collins
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"fa772f4014a57158c77f0f7b33cffba96dff1d04" fa772f4]:
{{{#!CommitTicketReference repository=""
revision="fa772f4014a57158c77f0f7b33cffba96dff1d04"
[6.0.x] Fixed #36669 -- Doc'd that negative indexes are not supported in
F() slices.

Backport of f715bc8990b5b8a1df948c2b71e8edbdda47e7db from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36669#comment:4>

Django

unread,
Oct 17, 2025, 10:23:03 AM10/17/25
to django-...@googlegroups.com
#36669: Document `Negative indexing is not supported` for slicing F() expressions
-------------------------------------+-------------------------------------
Reporter: AJ Collins | Owner: AJ
Type: | Collins
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"83f6fe810df8558339495ad717e216b14d34f461" 83f6fe81]:
{{{#!CommitTicketReference repository=""
revision="83f6fe810df8558339495ad717e216b14d34f461"
[5.2.x] Fixed #36669 -- Doc'd that negative indexes are not supported in
F() slices.

Backport of f715bc8990b5b8a1df948c2b71e8edbdda47e7db from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36669#comment:5>
Reply all
Reply to author
Forward
0 new messages