0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Django Admin フォームの並び替えを行う

Posted at

前提

  • DJango 2.2 (ドキュメントではDjango1.1からサポート)
  • Python3.6

コード

変更先はアプリケーション内のadmin.py。
ModelAdmin.fields に対してオーダリングを記述すればよい。

admin.py
@admin.register(Samples)
class SamplesAdmin(admin.ModelAdmin):
    form = froms.SamplesForm
    fields = (
        'name',
        'age',
        'qiita_urls',
        'memo',
    )
        

参考

The Django admin site

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?