# django-cards-admin
Show cards in changelist instead of table for django admin site.
## Install
```shell
pip install django-cards-admin
```
## Settings
**pro/settings.py**
```python
INSTALLED_APPS = [
...
"django_simple_tags",
"django_cards_admin",
...
]
```
## Usage
**app/admin.py**
```python
from django.contrib import admin
from django_cards_admin.admin import DjangoCardsAdminMixin
from .models import Book
class BookAdmin(DjangoCardsAdminMixin, admin.ModelAdmin):
result_cards_columns = 5
max_cards_number = 5
result_card_body_height = 200
list_display = ["title", "author", "isbn"]
admin.site.register(Book, BookAdmin)
```
## Configurations
- result_cards_columns = 4 # how many columns
- max_result_cards_number = 10 # if the number of the results is more than max_cards_number, show list instead of cards
- result_card_body_height = 100 # card body height in px
- result_card_body_min_width = 200 # card body min-width in px
- result_card_title_template = "result-card-title.html" # card title template, smart select by app_label and model_name
- result_card_body_template = "result-card-body.html" # card body template, smart select by app_label and model_name
- result_card_footer_template = "result-card-footer.html" # card footer template, smart select by app_label and model_name
## Release
### v0.1.0 2020/02/23
- First release.
### v0.2.0 2020/03/19
- Fix result-cards width problem in filtered changelist.
### v0.3.0 2020/03/21
- Add item link and link title override mechanism. Requires django-simple-tags>=0.4.0.
### v0.3.1 2020/04/28
- Remove print() statements in admin.py.
### v0.3.2 2023/09/15
- Doc update.
Raw data
{
"_id": null,
"home_page": "",
"name": "django-cards-admin",
"maintainer": "Shang JiangBao",
"docs_url": null,
"requires_python": "",
"maintainer_email": "shangjiangbao@zencore.cn",
"keywords": "django admin extentions,django cards admin",
"author": "Shang JiangBao",
"author_email": "shangjiangbao@zencore.cn",
"download_url": "https://files.pythonhosted.org/packages/c4/5a/d0a103ba2f685f0863fb4d7b1da1ca751d627e270df8643a3a9ffa862e40/django-cards-admin-0.3.2.tar.gz",
"platform": null,
"description": "# django-cards-admin\n\nShow cards in changelist instead of table for django admin site.\n\n## Install\n\n```shell\npip install django-cards-admin\n```\n\n## Settings\n\n**pro/settings.py**\n\n```python\nINSTALLED_APPS = [\n ...\n \"django_simple_tags\",\n \"django_cards_admin\",\n ...\n]\n```\n\n## Usage\n\n**app/admin.py**\n\n```python\nfrom django.contrib import admin\nfrom django_cards_admin.admin import DjangoCardsAdminMixin\nfrom .models import Book\n\nclass BookAdmin(DjangoCardsAdminMixin, admin.ModelAdmin):\n result_cards_columns = 5\n max_cards_number = 5\n result_card_body_height = 200\n list_display = [\"title\", \"author\", \"isbn\"]\n\nadmin.site.register(Book, BookAdmin)\n```\n\n## Configurations\n\n- result_cards_columns = 4 # how many columns\n- max_result_cards_number = 10 # if the number of the results is more than max_cards_number, show list instead of cards\n- result_card_body_height = 100 # card body height in px\n- result_card_body_min_width = 200 # card body min-width in px\n- result_card_title_template = \"result-card-title.html\" # card title template, smart select by app_label and model_name\n- result_card_body_template = \"result-card-body.html\" # card body template, smart select by app_label and model_name\n- result_card_footer_template = \"result-card-footer.html\" # card footer template, smart select by app_label and model_name\n\n## Release\n\n### v0.1.0 2020/02/23\n\n- First release.\n\n### v0.2.0 2020/03/19\n\n- Fix result-cards width problem in filtered changelist.\n\n### v0.3.0 2020/03/21\n\n- Add item link and link title override mechanism. Requires django-simple-tags>=0.4.0.\n\n### v0.3.1 2020/04/28\n\n- Remove print() statements in admin.py.\n\n### v0.3.2 2023/09/15\n\n- Doc update.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Show cards in changelist instead of table for django admin site.",
"version": "0.3.2",
"project_urls": null,
"split_keywords": [
"django admin extentions",
"django cards admin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a6b063e0acd344292cdfa0cfc3b95c1755a13e889e55b412e0e05dd460d2329a",
"md5": "ba39ebcab2435808cb1cbdfe7ced9edd",
"sha256": "163f0c0dad8fe9520d79d51dcc9b3dc3156f04064f200c8eb40b8cb90e26acd7"
},
"downloads": -1,
"filename": "django_cards_admin-0.3.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ba39ebcab2435808cb1cbdfe7ced9edd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6343,
"upload_time": "2023-09-15T09:50:30",
"upload_time_iso_8601": "2023-09-15T09:50:30.101228Z",
"url": "https://files.pythonhosted.org/packages/a6/b0/63e0acd344292cdfa0cfc3b95c1755a13e889e55b412e0e05dd460d2329a/django_cards_admin-0.3.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c45ad0a103ba2f685f0863fb4d7b1da1ca751d627e270df8643a3a9ffa862e40",
"md5": "b5e7a7bdd0c9bc1b9092377df809f34c",
"sha256": "a17255e47325ab0b6e703ef3319cae69e8228b8e516041833315f7f8f7e10398"
},
"downloads": -1,
"filename": "django-cards-admin-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "b5e7a7bdd0c9bc1b9092377df809f34c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5465,
"upload_time": "2023-09-15T09:50:32",
"upload_time_iso_8601": "2023-09-15T09:50:32.182177Z",
"url": "https://files.pythonhosted.org/packages/c4/5a/d0a103ba2f685f0863fb4d7b1da1ca751d627e270df8643a3a9ffa862e40/django-cards-admin-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-15 09:50:32",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "django-cards-admin"
}