Skip to content

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

License

Notifications You must be signed in to change notification settings

mihasK/django-admin-lazy-load

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ...

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published