Django-admin-decorators

Django Admin用の追加デコレータ
今すぐダウンロード

Django-admin-decorators ランキングとまとめ

広告

  • Rating:
  • ライセンス:
  • MIT/X Consortium Lic...
  • 価格:
  • FREE
  • 出版社名:
  • Mikhail Korobov
  • 出版社のWebサイト:
  • http://bitbucket.org/kmike/

Django-admin-decorators タグ


Django-admin-decorators 説明

Djangoの管理者はlist_displayおよびreadonly_fieldsの呼び出し可能ファイルを受け入れます。これらの呼び出し可能ファイルをカスタマイズするために(例えば説明で注釈を付ける)Djangoでは、発信者に属性を設定する必要があります(例えば 'short_description')。 Django-admin-decoratoratorは簡単なアプローチです。それは働きます。 django admin.installationpipのカスタマイズに便利な他のデコレータの2つのデコラルdjango-admin-decoratorusageDjango-admin-decoratorsusageFrom Django.Contribusage andictrfrom admin_decoratorsインポート(short_description、limit_width、boolean、apply_filter、order_field、allow_tags)mymodelclass mymodeladmin(admin.modeladmin) :list_display = 'name'、 '_text'、 'has_huge_text'、 'html_url' readonly_fields = @ short_description( 'the text)@ order_field(' text ')@ limit_width (100)DEF _TEXT(self、obj):obj.text @boolean @short_description(「テキストは巨大」)def has_huge_text(self、obj):len(obj.text)> 100 @short_description( 'link') )@ order_field( 'url')@ allow_tags @apply_filter( 'URLize')DEF HTML_URL(S elf、obj):obj.urladmin.site.register(mymodel、mymodeladmin)allow_tagsデコレータマークはsafeとして結果を付けるので、list_displayとreadonly_fieldsの両方でHTMLになります。 BitbucketとGithub.IFあなたがバグを見つけた、または新しいデコレータのアイデアを見つけた場合は、チケットを開いたり、プル・リクエストを送ったりしてください。


Django-admin-decorators 関連ソフトウェア