#16698 closed Cleanup/optimization (wontfix)
Docs: QuerySet slicing (SQL LIMIT)
| Reported by: | Thomas Güttler | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | 1.3 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The current documentation for QuerySet slicing (SQL LIMIT) should be improved:
https://docs.djangoproject.com/en/dev/topics/db/queries/#limiting-querysets
current: For example, this returns the first 5 objects (LIMIT 5): >>> Entry.objects.all()[:5]
add: No Exception will be raised, if there are fewer results. If there are only four entries in the database table, the result will contain four entries.
Change History (4)
comment:1 by , 14 years ago
| Cc: | added |
|---|
comment:2 by , 14 years ago
comment:3 by , 14 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
I asked on #django-dev, other developers agreed that the current doc is sufficient.
comment:4 by , 14 years ago
| Cc: | removed |
|---|
Note:
See TracTickets
for help on using tickets.
QuerySets behave consistently with both SQL and Python:
So the behavior of QuerySets is natural and expected.
In order to keep the docs straightforward, I think it's best to keep the text as is.