タイトル: get() returned more than one MynumberRegist -- it returned 2!
SEOタイトル: get() returned more than one ... -- it returned ...!
| この記事の要点 |
|---|
|
エラー内容
|
get() returned more than one ... -- it returned ...! |
発生条件/原因/対処法
以下のようにgetを使用して複数レコードを取得すると発生するエラー。
|
Users.objects.get(...) |
getはプライマリーやユニークキーを条件として指定して1レコードに絞る必要がある。
複数レコードの場合はfilterなどにすればよい。