回答編集履歴

4

a

2023/07/25 23:11

投稿

ForestSeo
ForestSeo

スコア2722

test CHANGED
@@ -1,7 +1,5 @@
1
1
  ```Python
2
-
3
2
  followers = [c.follower for c in connection]
4
-
5
3
  contents = Content.objects.filter(owner__in=followers)
6
-
4
+ ```
7
- ```のようにする
5
+ のようにする

3

訂正

2021/03/30 10:58

投稿

ForestSeo
ForestSeo

スコア2722

test CHANGED
@@ -1,6 +1,6 @@
1
1
  ```Python
2
2
 
3
- followers = [c.follower for i in connection]
3
+ followers = [c.follower for c in connection]
4
4
 
5
5
  contents = Content.objects.filter(owner__in=followers)
6
6
 

2

変更

2021/03/30 10:58

投稿

ForestSeo
ForestSeo

スコア2722

test CHANGED
@@ -1,15 +1,7 @@
1
1
  ```Python
2
2
 
3
- connection = Connection.objects.filter(following=request.user)[0]
3
+ followers = [c.follower for i in connection]
4
4
 
5
- ```のようにするか、
5
+ contents = Content.objects.filter(owner__in=followers)
6
6
 
7
- ```Python
7
+ ```のようにする
8
-
9
- from django.shortcuts import get_object_or_404
10
-
11
-
12
-
13
- connection = get_object_or_404(Connection, following=request.user)
14
-
15
- ```

1

訂正

2021/03/30 10:57

投稿

ForestSeo
ForestSeo

スコア2722

test CHANGED
@@ -2,4 +2,14 @@
2
2
 
3
3
  connection = Connection.objects.filter(following=request.user)[0]
4
4
 
5
+ ```のようにするか、
6
+
7
+ ```Python
8
+
9
+ from django.shortcuts import get_object_or_404
10
+
11
+
12
+
13
+ connection = get_object_or_404(Connection, following=request.user)
14
+
5
15
  ```