# django-fastadmin
django admin extensions.
## Install
```shell
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
### v0.1.0
- First release.
- Add UuidFieldSearchableAdmin.
- Add InlineBooleanFieldsAllowOnlyOneCheckedMixin.
### v0.1.1
- 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
- Add widgets.AceWidget.
### v0.3.0
- hange the directory structure of static files.
- Add models.SimpleTask. It's an abstract model.
- jQuery and jQuery plugins are moved to django-static-jquery3>=5.0.0.
### v0.3.1
- Rename zh_hans to zh_Hans.
- Depends on django-db-lock>=0.3.1.
- Add django-static-xxx depends.
### v0.3.2
- Add SimpleTaskService.
- Move service functions from model to service.
- Upgrade django_db_lock depends.
### v0.4.0
- Add widgets.TitleToCodeWidget.
- Add models.SimplePublishModel.
- Add many admin mixins.
- Add django-app-requires support.
### v0.5.0
- Add admin.AddAdminViewHelper.
- Add admin.ToggleFieldStateAdmin.
- Add admin.SimplePublishModelAdmin.
- Add admin.SetTopModelAdmin.
### v0.6.0
- Add admin.DjangoAdminGlobalMedia.
- Add admin.DjangoWithExtraContextAdmin.
- Add admin.DjangoDynamicMediaAdmin.
- Add admin.HiddenFieldsAdmin.
- Add admin.HideShowFieldsOnValueAdmin.
- Add admin.DjangoObjectToolbarAdmin.
- Add admin.DjangoSortableAdmin.
- Add depends.
### v0.6.1
- Upgrade django-db-lock, fix missing requests in setup problem.
### v0.6.2
- Fix DjangoWithExtraContextAdmin problem.
### v0.7.0
- Remove abstract models, so that django_fastadmin can forcus on admin extensions.
- SimpleTask moved to django_simpletask.
- SimplePublishModel and SimplePublishModelAdmin moved to django_simple_publish_model.
### v0.7.1
- Fix missing django-static-ace-builds problem.
### v0.7.2
- Fix InlineModelAdmin.has_add_permission(...) has obj paramter in Django 3.2 problem.
- Test in Django 3.2.
### v0.7.4
- Rename AddAdminViewHelper to ExtraViewsAdmin.
- ExtraViewsAdmin make define view function easy.
- DjangoObjectToolbarAdmin make define button function easy.
- DjangoSortableAdmin using ExtraViewsAdmin easier way to define move-up and move-down button views.
- We are not care about the version of fastutils, so let the end user to choose.
### v0.7.5
- Doc update.
Raw data
{
"_id": null,
"home_page": "",
"name": "django-fastadmin",
"maintainer": "Zhao GuangFan",
"docs_url": null,
"requires_python": "",
"maintainer_email": "zhaoguangfan@zencore.cn",
"keywords": "django admin extentions",
"author": "Zhao GuangFan",
"author_email": "zhaoguangfan@zencore.cn",
"download_url": "https://files.pythonhosted.org/packages/6b/ea/1cad8bd70668a7c3b8a076b163e9e37fa94fbdc4975a862222d71e50e9de/django-fastadmin-0.7.5.tar.gz",
"platform": null,
"description": "# django-fastadmin\n\ndjango admin extensions.\n\n## Install\n\n```shell\npip install django-fastadmin\n```\n\n## Usage\n\n**pro/settings.py**\n\n```\nINSTALLED_APPS = [\n ...\n \"django_static_jquery3\",\n \"django_static_ace_builds\",\n \"django_apiview\",\n 'django_fastadmin',\n ...\n]\n```\n\n- Add dependence package names in INSTALLED_APPS.\n\n\n## Installed Admin Extensions\n\n### Admin extends\n\n- AddAdminViewHelper\n- DisableAddPermissionMixin\n- DisableChangePermissionMixin\n- DisableDeleteActionMixin\n- DisableDeletePermissionMixin\n- DisableInlineEditingInAddingMixin\n- DjangoDynamicMediaAdmin\n- DjangoObjectToolbarAdmin\n- DjangoSortableAdmin\n- DjangoWithExtraContextAdmin\n- EditablePasswordField\n- ExtraViewsAdmin\n- HiddenFieldsAdmin\n- HideShowField\n- HideShowFieldsOnValueAdmin\n- InlineBooleanFieldsAllowOnlyOneCheckedMixin\n- InlineEditingHideOriginalMixin\n- InlineUniqueChoiceFieldsMixin\n- MarkPermissionsMixin\n- ResetToRandomPasswordField\n- SetTopModelAdmin\n- TextFieldAutoHeightMixin\n- TextFieldSetRowColumnMixin\n- ToggleFieldStateAdmin\n- UuidFieldSearchableAdmin\n- WithDisplayFieldsMixin\n\n### Widgets\n\n- AceWidget\n- TitleToCodeWidget\n\n### Forms\n\n### Filters\n\n\n## admin.InlineBooleanFieldsAllowOnlyOneCheckedMixin Usage\n\n- `django_static_jquery3` required in INSTALLED_APPS.\n- Add this mixin to inline class, and put it before TabularInline.\n- Add classes property\n - Add class InlineBooleanFieldsAllowOnlyOneCheckedMixin.special_class_name\n - Add class InlineBooleanFieldsAllowOnlyOneCheckedMixin.field_name_prefix + {field name},\n- Example:\n ```\n from django.contrib import admin\n from django_fastadmin.admin import InlineBooleanFieldsAllowOnlyOneCheckedMixin\n\n from .models import Book\n from .models import Category\n\n class BookInline(InlineBooleanFieldsAllowOnlyOneCheckedMixin, admin.TabularInline):\n model = Book\n extra = 0\n classes = [\n InlineBooleanFieldsAllowOnlyOneCheckedMixin.special_class_name,\n InlineBooleanFieldsAllowOnlyOneCheckedMixin.field_name_prefix + \"is_best_seller\",\n ]\n\n\n class CategoryAdmin(admin.ModelAdmin):\n inlines = [\n BookInline,\n ]\n\n admin.site.register(Category, CategoryAdmin)\n ```\n\n\n\n## widget.AceWidget Usage\n\n- `django_static_jquery3` and `django_static_ace_builds` required in INSTALLED_APPS.\n- Create a model_form, and set the admin's form to the model_form.\n- Set the field to use AceWidget in the model_form.\n- Example:\n```\nclass BookModelForm(forms.ModelForm):\n class Meta:\n model = Book\n fields = \"__all__\"\n widgets = {\n \"description\": AceWidget(ace_options={\n \"mode\": \"ace/mode/yaml\",\n \"theme\": \"ace/theme/twilight\",\n }),\n }\n\nclass BookAdmin(admin.ModelAdmin):\n form = BookModelForm\n list_display = [\"title\", \"published\"]\n\n```\n\n## Releases\n\n### v0.1.0\n\n- First release.\n- Add UuidFieldSearchableAdmin.\n- Add InlineBooleanFieldsAllowOnlyOneCheckedMixin.\n\n### v0.1.1\n\n- 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.\n\n### v0.2.0\n\n- Add widgets.AceWidget.\n\n### v0.3.0 \n\n- hange the directory structure of static files.\n- Add models.SimpleTask. It's an abstract model.\n- jQuery and jQuery plugins are moved to django-static-jquery3>=5.0.0.\n\n### v0.3.1\n\n- Rename zh_hans to zh_Hans.\n- Depends on django-db-lock>=0.3.1.\n- Add django-static-xxx depends.\n\n### v0.3.2\n\n- Add SimpleTaskService.\n- Move service functions from model to service.\n- Upgrade django_db_lock depends.\n\n### v0.4.0\n\n- Add widgets.TitleToCodeWidget.\n- Add models.SimplePublishModel.\n- Add many admin mixins.\n- Add django-app-requires support.\n\n### v0.5.0\n\n- Add admin.AddAdminViewHelper.\n- Add admin.ToggleFieldStateAdmin.\n- Add admin.SimplePublishModelAdmin.\n- Add admin.SetTopModelAdmin. \n\n### v0.6.0\n\n- Add admin.DjangoAdminGlobalMedia.\n- Add admin.DjangoWithExtraContextAdmin.\n- Add admin.DjangoDynamicMediaAdmin.\n- Add admin.HiddenFieldsAdmin.\n- Add admin.HideShowFieldsOnValueAdmin.\n- Add admin.DjangoObjectToolbarAdmin.\n- Add admin.DjangoSortableAdmin.\n- Add depends.\n\n### v0.6.1\n\n- Upgrade django-db-lock, fix missing requests in setup problem.\n\n### v0.6.2\n\n- Fix DjangoWithExtraContextAdmin problem.\n\n### v0.7.0\n\n- Remove abstract models, so that django_fastadmin can forcus on admin extensions.\n- SimpleTask moved to django_simpletask.\n- SimplePublishModel and SimplePublishModelAdmin moved to django_simple_publish_model.\n\n### v0.7.1\n\n- Fix missing django-static-ace-builds problem.\n\n### v0.7.2 \n\n- Fix InlineModelAdmin.has_add_permission(...) has obj paramter in Django 3.2 problem.\n- Test in Django 3.2.\n\n### v0.7.4\n\n- Rename AddAdminViewHelper to ExtraViewsAdmin.\n- ExtraViewsAdmin make define view function easy.\n- DjangoObjectToolbarAdmin make define button function easy.\n- DjangoSortableAdmin using ExtraViewsAdmin easier way to define move-up and move-down button views.\n- We are not care about the version of fastutils, so let the end user to choose.\n\n### v0.7.5\n\n- Doc update.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "django admin extensions.",
"version": "0.7.5",
"project_urls": null,
"split_keywords": [
"django",
"admin",
"extentions"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5412aa60f14c47a6abf6c380b15afb0db89be0927f6438a0322c180c48d7c0a7",
"md5": "6661f3062922bb4d69f3f095e05e54df",
"sha256": "af8bd9a3e17549106305fca6521e1cd0cdc27f247731227083d07f49a6710a1a"
},
"downloads": -1,
"filename": "django_fastadmin-0.7.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6661f3062922bb4d69f3f095e05e54df",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 32016,
"upload_time": "2023-09-15T02:34:39",
"upload_time_iso_8601": "2023-09-15T02:34:39.159592Z",
"url": "https://files.pythonhosted.org/packages/54/12/aa60f14c47a6abf6c380b15afb0db89be0927f6438a0322c180c48d7c0a7/django_fastadmin-0.7.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6bea1cad8bd70668a7c3b8a076b163e9e37fa94fbdc4975a862222d71e50e9de",
"md5": "eb9cd5d575f14a5674879463ff85420e",
"sha256": "07bf513d5aa66316bc1c18b93145d4d5759df2ff118c3b244c83a9ce749662fe"
},
"downloads": -1,
"filename": "django-fastadmin-0.7.5.tar.gz",
"has_sig": false,
"md5_digest": "eb9cd5d575f14a5674879463ff85420e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 24274,
"upload_time": "2023-09-15T02:34:41",
"upload_time_iso_8601": "2023-09-15T02:34:41.110883Z",
"url": "https://files.pythonhosted.org/packages/6b/ea/1cad8bd70668a7c3b8a076b163e9e37fa94fbdc4975a862222d71e50e9de/django-fastadmin-0.7.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-15 02:34:41",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "django-fastadmin"
}