Code

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#1342 closed enhancement (fixed)

Allow customization of MAX_SHOW_ALL_ALLOWED and DEFAULT_RESULTS_PER_PAGE in admin views

Reported by: russellm Owned by: adrian
Component: contrib.admin Version: magic-removal
Severity: normal Keywords: MAX_SHOW_ALL_ALLOWED DEFAULT_RESULTS_PER_PAGE
Cc: cleonello@… cmlenz@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Chris Leonello <cleonello@…> in this thread wondered:

Is there anyway to change the MAX_SHOW_ALL_ALLOWED and
DEFAULT_RESULTS_PER_PAGE variables short of editing the
contrib/admin/views/main.py file? Since these are parameters that
directly relate to presentation, it seems that they should be
controlled at a module level basis at least (or class level at best).

Attachments (1)

django_1342.diff (2.0 KB) - added by Christopher Lenz <cmlenz@…> 8 years ago.
Allow specifying the admin “results per page” per model

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by Christopher Lenz <cmlenz@…>

Allow specifying the admin “results per page” per model

comment:1 Changed 8 years ago by Christopher Lenz <cmlenz@…>

  • Cc cleonello@… added; cleonello@… removed
  • Version set to magic-removal

I've attached a small patch that lets you configure the “results per page” in the admin options of a model using the list_limit attribute.

For example:

class MyModel(models.Model):
    ...

    class Admin:
        list_display = ['name', 'description'],
        list_limit = 16

Setting this ticket to magic-removal because that's what the patch targets.

comment:2 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [2629]) magic-removal: Fixed #1342 -- Added list_per_page option to Admin options. Thanks, Christopher Lenz

comment:3 Changed 4 years ago by akaihola

Note: [2629] doesn't allow customizing MAX_SHOW_ALL_ALLOWED which was included in the original description as well. As of r12734 it's still not customizable.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.