Skip to main content

Show cards in changelist instead of table for django admin site.

Project description

django-cards-admin

Show cards in changelist instead of table for django admin site.

Install

pip install django-cards-admin

Settings

pro/settings.py

INSTALLED_APPS = [
    ...
    "django_simple_tags",
    "django_cards_admin",
    ...
]

Usage

app/admin.py

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.2.0 2020/03/19

  • Fix result-cards width problem in filtered changelist.

v0.1.0 2020/02/23

  • First release.

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-cards-admin-0.2.0.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file django-cards-admin-0.2.0.tar.gz.

File metadata

  • Download URL: django-cards-admin-0.2.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.8

File hashes

Hashes for django-cards-admin-0.2.0.tar.gz
Algorithm Hash digest
SHA256 03482d1c468606cbe765e1d3fabf3f16b22cf6aa56386a151ad3eec0806ea214
MD5 4311e46f9d349bf3647f88ed51e4901b
BLAKE2b-256 442c064937537e0157f467aab4c865efdfa2cf272c3399f0e330a41b5cfd83fb

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