Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
リスト アプリ リスト モデルをユーザーに関連付けるにはどうすればよいですか。ユーザー has_many リスト。
models.ForeignKey(User) を使用できるようにするために、List モデルに何を含める必要がありますか?
どうぞ (次回は Django のドキュメントを参照してください):
from django.db import models from django.contrib.auth.models import User class Listing(models.Model): user = models.ForeignKey(User)
お役に立てれば