teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

追加修正

2020/11/03 12:56

投稿

Msk07
Msk07

スコア26

title CHANGED
File without changes
body CHANGED
@@ -4,7 +4,6 @@
4
4
  ● エラー内容
5
5
  > 'LoginViewSet' should either include a `queryset` attribute, or override the `get_queryset()` method.
6
6
 
7
- mail_addressの名称が間違っているのではないかというエラーメッセージが発生するのですが、どのように修正すべきかわかりません。
8
7
  ● tree
9
8
  ```
10
9
  core

1

エラー内容を別のものと間違っていたため

2020/11/03 12:55

投稿

Msk07
Msk07

スコア26

title CHANGED
File without changes
body CHANGED
@@ -2,9 +2,7 @@
2
2
  Serializeがうまく行かないので間違っている箇所があればご教授頂きたいです。
3
3
 
4
4
  ● エラー内容
5
- > Got AttributeError when attempting to get a value for field `mail_address` on serializer `UserSerializer`.
6
- The serializer field might be named incorrectly and not match any attribute or key on the `QuerySet` instance.
5
+ > 'LoginViewSet' should either include a `queryset` attribute, or override the `get_queryset()` method.
7
- Original exception text was: 'QuerySet' object has no attribute 'mail_address'.
8
6
 
9
7
  mail_addressの名称が間違っているのではないかというエラーメッセージが発生するのですが、どのように修正すべきかわかりません。
10
8
  ● tree
@@ -48,7 +46,7 @@
48
46
 
49
47
  @action(detail=True, methods=['get'])
50
48
  def sign_in(self, request):
51
- serialized_user = UserSerializer(user_info.objects.all())
49
+ serialized_user = UserSerializer(user_info.objects.all(), many=True)
52
50
  return Response(serialized_user.data)
53
51
  ```
54
52
  ● user_info.py