質問編集履歴
5
修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
読み取り専用fieldsにfilterにかけて値を取得したい(django-rest-framework)
|
body
CHANGED
File without changes
|
4
修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
fieldのないデータをfilterにかけて値を取得したい(django-rest-framework)
|
body
CHANGED
File without changes
|
3
修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
nmodelにないカラムのデータをfilterにかけて値を取得したい(django-rest-framework)
|
body
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
そしてこの値(full_name)の値にfilterをかけて値を取得したいのですが、機能が実装できず困っております。
|
18
18
|
例
|
19
19
|
```
|
20
|
-
first_nameとlast_nameの頭文字をとって
|
20
|
+
first_nameとlast_nameの頭文字をとってthでクエリパラメータを投げたらfull_nameの条件一致している値を取得。
|
21
21
|
|
22
22
|
http://localhost:8000/person/?full_name=th/
|
23
23
|
|
2
名前の変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -9,8 +9,8 @@
|
|
9
9
|
結合カラム: full_name
|
10
10
|
|
11
11
|
jsonの表示内容 { first_name: 'tanaka',
|
12
|
-
last_name: '
|
12
|
+
last_name: 'hanako',
|
13
|
-
full_name: '
|
13
|
+
full_name: 'tanaka_hanako'←この値の事
|
14
14
|
}
|
15
15
|
```
|
16
16
|
|
@@ -19,12 +19,12 @@
|
|
19
19
|
```
|
20
20
|
first_nameとlast_nameの頭文字をとって1aでクエリパラメータを投げたらfull_nameの条件一致している値を取得。
|
21
21
|
|
22
|
-
http://localhost:8000/person/?full_name=
|
22
|
+
http://localhost:8000/person/?full_name=th/
|
23
23
|
|
24
24
|
|
25
25
|
JSON
|
26
26
|
{
|
27
|
-
full_name: '
|
27
|
+
full_name: 'tanaka_hanako'
|
28
28
|
}
|
29
29
|
```
|
30
30
|
|
1
カラムの内容について
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,9 +8,9 @@
|
|
8
8
|
カラム2: last_nameカラム
|
9
9
|
結合カラム: full_name
|
10
10
|
|
11
|
-
jsonの表示内容 { first_name: '
|
11
|
+
jsonの表示内容 { first_name: 'tanaka',
|
12
|
-
last_name: '
|
12
|
+
last_name: 'tarou',
|
13
|
-
full_name: '
|
13
|
+
full_name: 'tanaka_tarou'←この値の事
|
14
14
|
}
|
15
15
|
```
|
16
16
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
JSON
|
26
26
|
{
|
27
|
-
full_name: '
|
27
|
+
full_name: 'tanaka_tarou'
|
28
28
|
}
|
29
29
|
```
|
30
30
|
|