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

回答編集履歴

4

a

2023/07/25 23:11

投稿

ForestSeo
ForestSeo

スコア2724

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

3

訂正

2021/03/30 10:58

投稿

ForestSeo
ForestSeo

スコア2724

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

2

変更

2021/03/30 10:58

投稿

ForestSeo
ForestSeo

スコア2724

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

1

訂正

2021/03/30 10:57

投稿

ForestSeo
ForestSeo

スコア2724

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