すぐに外部キーに数値を追加するためのアプリケーションを構築します。モデル管理のDjangoでForeignKeyのすべてのインスタンスのすべての属性を編集します
私はDjangoの新機能を既に知っており、ここで関連する質問やDjangoのドキュメントを探しました。私が見つけたのはインラインAdminModelでしたが、それは本当に私が望むものではありません。
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
import datetime
from django.utils import timezone
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date= models.DateTimeField('date published')
def __str__(self):
return self.question_text
class Choice(models.Model):
question = models.ForeignKey(Question, on_delete= models.CASCADE)
choice_text = models.CharField(max_length = 200)
votes = models.IntegerField(default=0)
def __str__(self):
return self.choice_text
私はチュートリアルのコードを使用して、例えばForeignKey.Soのすべてのインスタンスを持つテーブルを持っていると思います、同時に、すべての質問にすべてのchoice_textと票を編集することが可能なはずである(1必ずしもそのようにコンテンツを追加するために異なる質問の間を飛び越えなければならない)。これは可能ですか? ご協力いただきありがとうございます!