Opened 18 years ago
Closed 13 years ago
#7005 closed New feature (fixed)
add orphans support for object_list pagination
| Reported by: | shadfc | Owned by: | shadfc |
|---|---|---|---|
| Component: | Generic views | Version: | dev |
| Severity: | Normal | Keywords: | orphans object_list paginator |
| Cc: | dima@… | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | yes | Patch needs improvement: | yes |
| Easy pickings: | no | UI/UX: | no |
Description
When the new Paginator support was added to the object_list generic view, support for the orphans feature was left out. This could be enabled simply by including the orphans key in the dictionary passed to the view. It would, of course, only be used when the view is paginated.
info_dict = {
'queryset' : Model.objects.all(),
'paginate_by' : 10,
'orphans' : 3,
}
Given this example, up to 13 objects would be included on a page, instead of only a hard limit of 10.
Attachments (2)
Change History (20)
by , 18 years ago
| Attachment: | object_list-orphans-support.diff added |
|---|
comment:1 by , 18 years ago
| Has patch: | set |
|---|---|
| Needs documentation: | set |
| Needs tests: | set |
comment:2 by , 18 years ago
| Patch needs improvement: | set |
|---|
comment:3 by , 17 years ago
| Triage Stage: | Unreviewed → Design decision needed |
|---|
comment:4 by , 17 years ago
| milestone: | → post-1.0 |
|---|
by , 17 years ago
| Attachment: | misc-orphans-fixes-8147.diff added |
|---|
orphan support for object_list, and documentation updates for generic views and paginator
comment:5 by , 17 years ago
| Needs documentation: | unset |
|---|---|
| Needs tests: | unset |
| Owner: | changed from to |
| Patch needs improvement: | unset |
| Status: | new → assigned |
Added a patch with documentation against rev 8147. This patch adds the orphans support to the object_list generic view and updates the documentation for it. It also updates the paginator documentation to include information about orphans.
I couldn't find any tests regarding object_list to update, and while that's not an excuse...
comment:6 by , 17 years ago
| Triage Stage: | Design decision needed → Accepted |
|---|
comment:9 by , 16 years ago
| Needs tests: | set |
|---|---|
| Triage Stage: | Accepted → Design decision needed |
If you feel passionate about it, feel free to bring it up in the django-dev google group.
A quick review says this looks near ready for checkin if it is considered worthy. My only point would be that for full backwards compatibility, the new argument should be added to the end of the generic view definition. And yeah, no current tests isn't a good excuse ;)
As an aside, the docs in the patch regarding Paginator orphans are good and should be committed either way. If someone was motivated to separate this to a different ticket, that would be good.
comment:10 by , 15 years ago
| Patch needs improvement: | set |
|---|---|
| Triage Stage: | Design decision needed → Accepted |
Also need to be updated for class-based views.
comment:11 by , 15 years ago
| Severity: | → Normal |
|---|---|
| Type: | → New feature |
comment:12 by , 15 years ago
| Cc: | added |
|---|
comment:17 by , 13 years ago
Seems to me it may be better to implement this in the context of CBVs as get_paginator_kwargs, a bit like get_form_kwargs rather than a separate method for each variable. Obviously we've got most of them already which we couldn't get rid of without backwards compat, but it's much more future proof.
comment:18 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
patch against rev 7412 adding orphans support to object_list