Skip to main content

Allows to speed-up loading of django admin page by loading heavy calculated field in lazy maner - via separate ajax requests.

Project description

django-admin-lazy-load

PyPI - Version

Allows to speed-up loading of django admin page by deffering (lazy loading) heavy calculated field - via separate ajax requests.

Super-easy yet flexible set-up. Supports any kind of admin fields including:

  • properties defined on model level
  • properties defined in admin class

Please look into example admin.py for different cases.

demo

Install

  1. pip install django-admin-lazy-load
  2. Add "admin_lazy_load" to INSTALLED_APPS
  3. Make sure django.contrib.staticfiles.finders.AppDirectoriesFinder is not disabled in your settings.

Usage

from admin_lazy_load import LazyLoadAdminMixin

....

class YourModelAdmin(LazyLoadAdminMixin, ModelAdmin):
    ...
    lazy_loaded_fields = (
        'calculated_value'
    )
    list_display = (
        ...
        'calculated_value_lazy_click'
        ...
    )

    def calculated_value(self, obj):
        return ...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_admin_lazy_load_alexforks-0.2.2.tar.gz (21.1 kB view hashes)

Uploaded Source

Built Distribution

django_admin_lazy_load_alexforks-0.2.2-py2.py3-none-any.whl (21.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page