質問編集履歴
2
index.htmlを追記いたします
title
CHANGED
File without changes
|
body
CHANGED
@@ -3,8 +3,6 @@
|
|
3
3
|
図-2のようにMultiValueDictKeyErrorが発生します。
|
4
4
|
ちなみに、4つのclickボタンのどれを押しても全く同じ挙動のerrorが発生します。
|
5
5
|
ソースコードの一部は下記のとおりです。恐縮ですが、errorの解決方法についてご教授いただけたら幸いです。
|
6
|
-
|
7
|
-
|
8
6
|
図-1 アプリ画面
|
9
7
|

|
10
8
|
|
@@ -13,13 +11,10 @@
|
|
13
11
|
|
14
12
|
ソースコード
|
15
13
|
(views.py)
|
16
|
-
|
17
14
|
```
|
18
15
|
@login_required
|
19
16
|
def mainpage(request):
|
20
17
|
|
21
|
-
|
22
|
-
|
23
18
|
if request.method =='POST':
|
24
19
|
if request.POST['mode']=='__workrequest_recognition__':
|
25
20
|
gps=workrequest.objects.filter(worker=request.user)
|
@@ -133,11 +128,8 @@
|
|
133
128
|
ccc=group_requestresponse.objects.filter(requester=request.user)
|
134
129
|
ccc.delete()
|
135
130
|
return redirect(to='yoteihyo/')
|
136
|
-
|
131
|
+
|
137
132
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
133
|
else:
|
142
134
|
|
143
135
|
Workrequest_recognition='2'
|
@@ -153,7 +145,7 @@
|
|
153
145
|
Workrequest_recognition=workrequest_recognition(workrequests)
|
154
146
|
|
155
147
|
|
156
|
-
|
148
|
+
|
157
149
|
requestresponsecount=workrequestresponse.objects.filter(requester=request.user).count()
|
158
150
|
if requestresponsecount>0:
|
159
151
|
requestresponsehtml=workrequestresponse.objects.filter(requester=request.user)
|
@@ -163,14 +155,13 @@
|
|
163
155
|
requestresponsehtml='仕事依頼に対する返信はありません'
|
164
156
|
requestresponseform=' '
|
165
157
|
|
166
|
-
|
158
|
+
|
167
159
|
ggg=group_request.objects.filter(groupowner=request.user)
|
168
160
|
grouprequests=[]
|
169
161
|
for item in ggg:
|
170
162
|
grouprequests.append(item.id)
|
171
163
|
Grouprequest_recognition=group_request_recognition(grouprequests)
|
172
164
|
|
173
|
-
"""グループリクエスト承認処理"""
|
174
165
|
grouprequestresponsecount=group_requestresponse.objects.filter(owner=request.user).count()
|
175
166
|
if grouprequestresponsecount>0:
|
176
167
|
grouprequestresponsehtml=group_requestresponse.objects.filter(owner=request.user)
|
@@ -192,4 +183,92 @@
|
|
192
183
|
|
193
184
|
|
194
185
|
return render(request, 'schedule_app/index.html', params)
|
186
|
+
```
|
187
|
+
index.html
|
188
|
+
```
|
189
|
+
{% extends 'base.html' %}
|
190
|
+
{% block content %}
|
191
|
+
<style>
|
192
|
+
.minute-wrapper {
|
193
|
+
border: 1px solid #eceeef;
|
194
|
+
}
|
195
|
+
|
196
|
+
.hour-name {
|
197
|
+
padding: 5px;
|
198
|
+
text-align: right;
|
199
|
+
border: 1px solid #eceeef;
|
200
|
+
}
|
201
|
+
|
202
|
+
.just-hour {
|
203
|
+
border-top: 1px solid #eceeef;
|
204
|
+
}
|
205
|
+
</style>
|
206
|
+
<div class="container">
|
207
|
+
<div class="row mt-5">
|
208
|
+
<div class="col-sm-4">
|
209
|
+
{{ time_schedule }}
|
210
|
+
|
211
|
+
</div>
|
212
|
+
<div class="col-sm-4 bg-info text-white">
|
213
|
+
<form action="{% url 'index' %}" method="post">
|
214
|
+
{% csrf_token %}
|
215
|
+
{{ getdata.as_table }}
|
216
|
+
<tr><td></td><td><input type="submit" value="click"></td></tr>
|
217
|
+
</form>
|
218
|
+
</div>
|
219
|
+
<div class="col-sm-4 bg-info text-white">
|
220
|
+
<form action="{% url 'index' %}" method="post">
|
221
|
+
{% csrf_token %}
|
222
|
+
{{ Grouprequest_recognition.as_table }}
|
223
|
+
<tr><td></td><td><input type="submit" value="click"></td></tr>
|
224
|
+
</form>
|
225
|
+
</div>
|
226
|
+
</div><!-- /.row -->
|
227
|
+
<div class="row mt-4">
|
228
|
+
<div class="col-sm-8 bg-info text-white">
|
229
|
+
{%for item in requestresponsehtml%}
|
230
|
+
<tr>
|
231
|
+
<td>{{item}}</td>
|
232
|
+
<tr>
|
233
|
+
{% endfor %}
|
234
|
+
</div>
|
235
|
+
<div class="col-sm-4 bg-info text-white">
|
236
|
+
<form action="{% url 'index' %}" method="post">
|
237
|
+
{% csrf_token %}
|
238
|
+
{{ requestresponseform }}
|
239
|
+
<tr><td></td><td><input type="submit" value="click"></td></tr>
|
240
|
+
</form>
|
241
|
+
</div><!-- /.row -->
|
242
|
+
|
243
|
+
<div class="row mt-4">
|
244
|
+
<div class="col-sm-8 bg-info text-white">
|
245
|
+
{%for item in grouprequestresponsehtml%}
|
246
|
+
<tr>
|
247
|
+
<td>{{item}}</td>
|
248
|
+
<tr>
|
249
|
+
{% endfor %}
|
250
|
+
</div>
|
251
|
+
<div class="col-sm-4 bg-info text-white">
|
252
|
+
<form action="{% url 'index' %}" method="post">
|
253
|
+
{% csrf_token %}
|
254
|
+
{{grouprequestresponseform}}
|
255
|
+
<tr><td></td><td><input type="submit" value="click"></td></tr>
|
256
|
+
</form>
|
257
|
+
</div><!-- /.row -->
|
258
|
+
|
259
|
+
<div class="row mt-2">
|
260
|
+
<div class="col-sm-4">
|
261
|
+
<P><a href="{% url 'newwork' %}">予定の追加</a></P>
|
262
|
+
</div>
|
263
|
+
<div class="col-sm-4">
|
264
|
+
<P><a href="{% url 'newworkrequest' %}">仕事リクエスト作成</a></P>
|
265
|
+
</div>
|
266
|
+
<div class="col-sm-4">
|
267
|
+
<P><a href="{% url 'makeorapplygroup' %}">グループ作成、申請</a></P>
|
268
|
+
</div>
|
269
|
+
</div><!-- /.row -->
|
270
|
+
</div><!-- /.container -->
|
271
|
+
{% endblock %}
|
272
|
+
|
273
|
+
|
195
274
|
```
|
1
ご指摘いただき誠にありがとうございます。コード部分を```で囲みました。```で囲まないとコードとして認識されないのですね。これから気を付けます。
title
CHANGED
File without changes
|
body
CHANGED
@@ -14,6 +14,7 @@
|
|
14
14
|
ソースコード
|
15
15
|
(views.py)
|
16
16
|
|
17
|
+
```
|
17
18
|
@login_required
|
18
19
|
def mainpage(request):
|
19
20
|
|
@@ -190,4 +191,5 @@
|
|
190
191
|
}
|
191
192
|
|
192
193
|
|
193
|
-
return render(request, 'schedule_app/index.html', params)
|
194
|
+
return render(request, 'schedule_app/index.html', params)
|
195
|
+
```
|