Skip to main content

django admin extensions.

Project description

django-fastadmin

django admin extensions.

Install

pip install django-fastadmin

Usage

pro/settings.py

INSTALLED_APPS = [
    ...
    "django_static_jquery3",
    "django_static_ace_builds",
    "django_apiview",
    'django_fastadmin',
    ...
]
  • Add dependence package names in INSTALLED_APPS.

Installed Admin Extensions

Admin extends

  • AddAdminViewHelper
  • DisableAddPermissionMixin
  • DisableChangePermissionMixin
  • DisableDeleteActionMixin
  • DisableDeletePermissionMixin
  • DisableInlineEditingInAddingMixin
  • DjangoDynamicMediaAdmin
  • DjangoObjectToolbarAdmin
  • DjangoSortableAdmin
  • DjangoWithExtraContextAdmin
  • EditablePasswordField
  • ExtraViewsAdmin
  • HiddenFieldsAdmin
  • HideShowField
  • HideShowFieldsOnValueAdmin
  • InlineBooleanFieldsAllowOnlyOneCheckedMixin
  • InlineEditingHideOriginalMixin
  • InlineUniqueChoiceFieldsMixin
  • MarkPermissionsMixin
  • ResetToRandomPasswordField
  • SetTopModelAdmin
  • TextFieldAutoHeightMixin
  • TextFieldSetRowColumnMixin
  • ToggleFieldStateAdmin
  • UuidFieldSearchableAdmin
  • WithDisplayFieldsMixin

Widgets

  • AceWidget
  • TitleToCodeWidget

Forms

Filters

admin.InlineBooleanFieldsAllowOnlyOneCheckedMixin Usage

  • django_static_jquery3 required in INSTALLED_APPS.
  • 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)
    

widget.AceWidget Usage

  • django_static_jquery3 and django_static_ace_builds required in INSTALLED_APPS.
  • Create a model_form, and set the admin's form to the model_form.
  • Set the field to use AceWidget in the model_form.
  • Example:
class BookModelForm(forms.ModelForm):
    class Meta:
        model = Book
        fields = "__all__"
        widgets = {
            "description": AceWidget(ace_options={
                "mode": "ace/mode/yaml",
                "theme": "ace/theme/twilight",
            }),
        }

class BookAdmin(admin.ModelAdmin):
    form = BookModelForm
    list_display = ["title", "published"]

Releases

Release Time Changes Notice
v0.1.0 2020/08/12 1. First release.
2. Add UuidFieldSearchableAdmin.
3. Add InlineBooleanFieldsAllowOnlyOneCheckedMixin.
v0.1.1 2020/08/13 4. 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.2.0 2020/08/25 5. Add widgets.AceWidget.
v0.3.0 2020/09/01 6. Change the directory structure of static files.
7. Add models.SimpleTask. It's an abstract model.
8. jQuery and jQuery plugins are moved to django-static-jquery3>=5.0.0.
v0.3.1 2020/09/01 9. Rename zh_hans to zh_Hans.
10. Depends on django-db-lock>=0.3.1.
11. Add django-static-xxx depends.
No deps on django-db-lock
v0.3.2 2020/09/08 12. Add SimpleTaskService.
13. Move service functions from model to service.
14. Upgrade django_db_lock depends.
v0.4.0 2020/09/23 15. Add widgets.TitleToCodeWidget.
16. Add models.SimplePublishModel.
17. Add many admin mixins.
18. Add app_requires.
SimplePublishModel removed.
v0.5.0 2020/10/01 19. Add admin.AddAdminViewHelper.
20. Add admin.ToggleFieldStateAdmin.
21. Add admin.SimplePublishModelAdmin.
22. Add admin.SetTopModelAdmin.
v0.6.0 2020/10/13 23. Add admin.DjangoAdminGlobalMedia.
24. Add admin.DjangoWithExtraContextAdmin.
25. Add admin.DjangoDynamicMediaAdmin.
26. Add admin.HiddenFieldsAdmin.
27. Add admin.HideShowFieldsOnValueAdmin.
28. Add admin.DjangoObjectToolbarAdmin.
29. Add admin.DjangoSortableAdmin.
30. Add depends.
v0.6.1 2020/10/21 31. Upgrade django-db-lock, fix missing requests in setup problem.
v0.6.2 2020/10/24 32. Fix DjangoWithExtraContextAdmin problem.
v0.7.0 2020/10/27 33. Remove abstract models, so that django_fastadmin can forcus on admin extensions.
34. SimpleTask moved to django_simpletask.
35. SimplePublishModel and SimplePublishModelAdmin moved to django_simple_publish_model.
v0.7.1 2020/11/08 36. Fix missing django-static-ace-builds problem.
v0.7.2 2021/04/13 37. Fix InlineModelAdmin.has_add_permission(...) has obj paramter in Django 3.2 problem.
38. Test in Django 3.2.
v0.7.3 2021/04/15 39. Rename AddAdminViewHelper to ExtraViewsAdmin.
40. ExtraViewsAdmin make define view function easy.
41. DjangoObjectToolbarAdmin make define button function easy.
42. DjangoSortableAdmin using ExtraViewsAdmin easier way to define move-up and move-down button views.
v0.7.4 2021/06/09 43. We are not care about the version of fastutils, so let the end user to choose.

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.7.4.tar.gz (25.4 kB view details)

Uploaded Source

Built Distribution

django_fastadmin-0.7.4-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-fastadmin-0.7.4.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for django-fastadmin-0.7.4.tar.gz
Algorithm Hash digest
SHA256 8f8ff5a6adfd9ac47187a8ab50705f1e2a3c5c3feac30a49fef80b899e6eff2a
MD5 bb286f7213c0c83215a15c7df1543575
BLAKE2b-256 4c74609e1d98cf977dcd74b6ac336a72b83f9fbbe3ecb07e042f579f0cf721db

See more details on using hashes here.

File details

Details for the file django_fastadmin-0.7.4-py3-none-any.whl.

File metadata

  • Download URL: django_fastadmin-0.7.4-py3-none-any.whl
  • Upload date:
  • Size: 32.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for django_fastadmin-0.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4f62e4def71283d440d8c6e0d796dc5ecf92e41724eba9f0c9829617689ca9cd
MD5 8ed51efaee98b7cfb3c86aa27cc4242b
BLAKE2b-256 40d18ff8015f7cd2b6d5a4fb5215d762df79faa84316fe198c8a090c8d29ea04

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