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.
ビデオレッスンを購入するためのインターネットショップがあります。ここで、制約を追加する必要があると思います。人々は1日1回(24時間)ビデオレッスンを見ることができます。その日にすでにビデオファイルが視聴されていたことをどうやって知ることができますか?
ビデオが視聴された日付でユーザーとビデオをマップする新しいモデルを作成します。次に、ユーザーがその日にビデオを視聴したかどうかを確認できます。
class VideoViewed(models.Model): user = models.ForeignKey(User) page = models.ForeignKey(Video) date = models.DateTimeField() manager = ResultManager()