Django

Code

Ticket #1342 (closed: fixed)

Opened 3 years ago

Last modified 2 years ago

Allow customization of MAX_SHOW_ALL_ALLOWED and DEFAULT_RESULTS_PER_PAGE in admin views

Reported by: russellm Assigned to: adrian
Milestone: Component: django.contrib.admin
Version: magic-removal Keywords: MAX_SHOW_ALL_ALLOWED DEFAULT_RESULTS_PER_PAGE
Cc: cleonello@yahoo.com cmlenz@gmx.de Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Chris Leonello <cleonello@yahoo.com> 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

django_1342.diff (2.0 kB) - added by Christopher Lenz <cmlenz@gmx.de> on 04/07/06 09:59:55.
Allow specifying the admin “results per page” per model

Change History

04/07/06 09:59:55 changed by Christopher Lenz <cmlenz@gmx.de>

  • attachment django_1342.diff added.

Allow specifying the admin “results per page” per model

04/07/06 10:02:21 changed by Christopher Lenz <cmlenz@gmx.de>

  • cc changed from cleonello@yahoo.com to cleonello@yahoo.com cmlenz@gmx.de.
  • 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.

04/07/06 10:38:39 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #1342 (Allow customization of MAX_SHOW_ALL_ALLOWED and DEFAULT_RESULTS_PER_PAGE in admin views)




Change Properties
Action