#5115 closed (fixed)
ORM does not support query set subscription with long numbers
| Reported by: | Owned by: | Adrian Holovaty | |
|---|---|---|---|
| Component: | Core (Other) | Version: | dev |
| Severity: | Keywords: | orm query set slice indexing | |
| Cc: | zboczuch@… | Triage Stage: | Unreviewed |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
> from app.models import foo > foo.objects.all()[2L] <type 'exceptions.TypeError'>
Longs are allowed in slices. I think the problem is in django/db/models/query.py:
{{
def getitem(self, k):
"Retrieve an item or slice from the set of results."
if not isinstance(k, (slice, int)):
}}
"long" should be added to the type list above.
Change History (5)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
| Cc: | added |
|---|
follow-up: 5 comment:3 by , 18 years ago
Ooops! This ticket system shows my email to everyone. Is there a possibility to hide it?
comment:4 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:5 by , 18 years ago
Replying to zboczuch <zboczuch@paranoja.pl>:
Ooops! This ticket system shows my email to everyone. Is there a possibility to hide it?
I could remove your email from the ticket description and cc, but I don't think I could do anything about the comments.
Hm... My mistake in formating:
def getitem(self, k): "Retrieve an item or slice from the set of results." if not isinstance(k, (slice, int)):