回答編集履歴
1
修正
test
CHANGED
@@ -57,3 +57,35 @@
|
|
57
57
|
```
|
58
58
|
|
59
59
|
こんな感じでどうでしょう?
|
60
|
+
|
61
|
+
***
|
62
|
+
|
63
|
+
**追記**
|
64
|
+
|
65
|
+
```Python
|
66
|
+
|
67
|
+
# views.py
|
68
|
+
|
69
|
+
def fix_update(request, id):
|
70
|
+
|
71
|
+
user = get_object_or_404(User, id=id)
|
72
|
+
|
73
|
+
obj = user.fix
|
74
|
+
|
75
|
+
form = FixedForm(instance=obj)
|
76
|
+
|
77
|
+
if request.method == 'POST':
|
78
|
+
|
79
|
+
form = FixedForm(request.POST, instance=obj)
|
80
|
+
|
81
|
+
form.save()
|
82
|
+
|
83
|
+
return redirect(reverse_lazy('register:user_list'))
|
84
|
+
|
85
|
+
return render(request, 'shift/fix.html', {
|
86
|
+
|
87
|
+
'form':form,'users':user,
|
88
|
+
|
89
|
+
})
|
90
|
+
|
91
|
+
```こんな感じでいけませんか?
|