Skip to main content

django admin extensions.

Project description

django-fastadmin

django admin extensions.

Install

pip install django-fastadmin

Installed Admin Extensions

Admin extends

  • UuidFieldSearchableAdmin
  • InlineBooleanFieldsAllowOnlyOneCheckedMixin

Widgets

Forms

Filters

Jquery Generic Plugins

Note:

  • $.fn.xxx is jQuery object related util.
  • $.xxx is simple util in jQuery namespace.
  • All jquery plugin files are prefixed with django-jquery-plugins/.
  • Add admin/js/vendor/jquery/jquery.js at the first and add admin/js/jquery.init.js at the last in your js list. Use django_fastadmin.admin.jquery_plugins([...your jquery files...]) for easy.
File Plugin Name Memo
jquery.utils.js $.fn.classes
jquery.cookie.js $.cookie
jquery.cookie.js $.removeCookie

InlineBooleanFieldsAllowOnlyOneCheckedMixin Usage

  • Add this mixin to inline class, and put it before TabularInline.
  • Add classes property
    • Add class InlineBooleanFieldsAllowOnlyOneCheckedMixin.special_class_name
    • Add class InlineBooleanFieldsAllowOnlyOneCheckedMixin.field_name_prefix + {field name},
  • Example:
    from django.contrib import admin
    from django_fastadmin.admin import InlineBooleanFieldsAllowOnlyOneCheckedMixin
    
    from .models import Book
    from .models import Category
    
    class BookInline(InlineBooleanFieldsAllowOnlyOneCheckedMixin, admin.TabularInline):
        model = Book
        extra = 0
        classes = [
            InlineBooleanFieldsAllowOnlyOneCheckedMixin.special_class_name,
            InlineBooleanFieldsAllowOnlyOneCheckedMixin.field_name_prefix + "is_best_seller",
            ]
    
    
    class CategoryAdmin(admin.ModelAdmin):
        inlines = [
            BookInline,
        ]
    
    admin.site.register(Category, CategoryAdmin)
    

Bug report

Please report any issues at https://github.com/zencore-cn/zencore-issues.

Releases

v0.1.1 2020/08/13

  • Fix jquery.js and jquery.init.js including orders, so that we don't need to change js plugin's source to use django.jQuery.

v0.1.0 2020/08/12

  • First release.
  • Add UuidFieldSearchableAdmin.
  • Add InlineBooleanFieldsAllowOnlyOneCheckedMixin.

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-fastadmin-0.1.1.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file django-fastadmin-0.1.1.tar.gz.

File metadata

  • Download URL: django-fastadmin-0.1.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.8

File hashes

Hashes for django-fastadmin-0.1.1.tar.gz
Algorithm Hash digest
SHA256 de412e9e0a5a6e69dfea135475eebd75c7c27605ef037c75ebd7979bb14347e0
MD5 a70ab87b4075869baada22df40a4cec0
BLAKE2b-256 029c79f651a896ca527267c4d913d35a030723b17aded4c2e7e20edfe0e9350d

See more details on using hashes here.

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