問題タブ [django-shell]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
1020 参照

django - Django Shell でモデルのすべてのフィールドを取得する

Django Shell で特定のモデルのすべてのフィールドの名前を出力することは可能ですか? たとえば、Userモデルからフィールドを取得する方法:

該当するアプリにアクセスすることで取得できることはわかってmodels.pyいますが、同じ場所ですべてのアプリのモデルに関する情報を取得する方が便利です。