回答編集履歴
1
コメントに対する回答を追記
test
CHANGED
@@ -9,3 +9,27 @@
|
|
9
9
|
{{ form.teacher_id.as_hidden }}
|
10
10
|
|
11
11
|
```
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
```python
|
16
|
+
|
17
|
+
# views.py
|
18
|
+
|
19
|
+
def CreateRoom(request):
|
20
|
+
|
21
|
+
if request.method == 'POST':
|
22
|
+
|
23
|
+
form = CreateRoomForm(request.POST)
|
24
|
+
|
25
|
+
if form.is_valid():
|
26
|
+
|
27
|
+
# room_data = Room.objects.filter(teacher_id=form.cleaned_data.get('pk'), customer_id=request.user.pk)
|
28
|
+
|
29
|
+
room_data = Room.objects.filter(
|
30
|
+
|
31
|
+
teacher_id=form.cleaned_data.get('teacher_id'),
|
32
|
+
|
33
|
+
customer_id=request.user.pk)
|
34
|
+
|
35
|
+
```
|