質問編集履歴
2
回答内容反映後、追加で質問するために画像と編集内容を記載
test
CHANGED
File without changes
|
test
CHANGED
@@ -36,6 +36,12 @@
|
|
36
36
|
|
37
37
|
|
38
38
|
|
39
|
+
**→回答内容反映後**
|
40
|
+
|
41
|
+
![イメージ説明](d1fa01926e76381f0aceeafdb329f0be.png)
|
42
|
+
|
43
|
+
|
44
|
+
|
39
45
|
### 該当のソースコード
|
40
46
|
|
41
47
|
|
@@ -78,6 +84,40 @@
|
|
78
84
|
|
79
85
|
|
80
86
|
|
87
|
+
→回答内容反映後
|
88
|
+
|
89
|
+
```Python
|
90
|
+
|
91
|
+
{% extends 'manager/base.html' %}
|
92
|
+
|
93
|
+
{% load bootstrap4 %}
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
{% block main %}
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<h1>新規作成</h1>
|
102
|
+
|
103
|
+
<form method="post">
|
104
|
+
|
105
|
+
{% csrf_token %}
|
106
|
+
|
107
|
+
{% bootstrap_form form layout="horizontal" %} # 編集
|
108
|
+
|
109
|
+
<button type="submit" class="btn btn-primary">登録</button>
|
110
|
+
|
111
|
+
</form>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
{% endblock main %}
|
116
|
+
|
117
|
+
```
|
118
|
+
|
119
|
+
|
120
|
+
|
81
121
|
models.py
|
82
122
|
|
83
123
|
```
|
@@ -214,6 +254,12 @@
|
|
214
254
|
|
215
255
|
|
216
256
|
|
257
|
+
→回答後、参照
|
258
|
+
|
259
|
+
[参照箇所](https://qiita.com/kaki_k/items/6e17597804437ef170ae)
|
260
|
+
|
261
|
+
|
262
|
+
|
217
263
|
### 補足情報(FW/ツールのバージョンなど)
|
218
264
|
|
219
265
|
|
1
models.pyを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -78,6 +78,132 @@
|
|
78
78
|
|
79
79
|
|
80
80
|
|
81
|
+
models.py
|
82
|
+
|
83
|
+
```
|
84
|
+
|
85
|
+
from django.db import models
|
86
|
+
|
87
|
+
from django.urls import reverse
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
class Employee_inf(models.Model):
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
no = models.CharField(
|
98
|
+
|
99
|
+
max_length=4,
|
100
|
+
|
101
|
+
primary_key=True,
|
102
|
+
|
103
|
+
verbose_name="社員番号",
|
104
|
+
|
105
|
+
)
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
name = models.CharField(
|
110
|
+
|
111
|
+
max_length=10,
|
112
|
+
|
113
|
+
verbose_name="名前",
|
114
|
+
|
115
|
+
)
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
kana = models.CharField(
|
120
|
+
|
121
|
+
max_length=15,
|
122
|
+
|
123
|
+
verbose_name="かな",
|
124
|
+
|
125
|
+
)
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
b_day = models.DateField(
|
130
|
+
|
131
|
+
auto_now=False,
|
132
|
+
|
133
|
+
auto_now_add=False,
|
134
|
+
|
135
|
+
verbose_name="誕生日",
|
136
|
+
|
137
|
+
)
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
tel = models.CharField(
|
142
|
+
|
143
|
+
max_length=50,
|
144
|
+
|
145
|
+
verbose_name="電話番号",
|
146
|
+
|
147
|
+
)
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
a_id = models.EmailField(
|
152
|
+
|
153
|
+
max_length=64,
|
154
|
+
|
155
|
+
verbose_name="Apple ID",
|
156
|
+
|
157
|
+
)
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
a_pass = models.CharField(
|
162
|
+
|
163
|
+
max_length=10,
|
164
|
+
|
165
|
+
verbose_name="パスワード",
|
166
|
+
|
167
|
+
)
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
remarks = models.TextField(
|
172
|
+
|
173
|
+
max_length=250,
|
174
|
+
|
175
|
+
blank=True,
|
176
|
+
|
177
|
+
null=True,
|
178
|
+
|
179
|
+
verbose_name="備考",
|
180
|
+
|
181
|
+
)
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
def get_absolute_url(self):
|
186
|
+
|
187
|
+
return reverse("detail", args={self.pk})
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
def __str__(self):
|
192
|
+
|
193
|
+
return self.name
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
class Meta:
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
verbose_name_plural = "社員情報"
|
202
|
+
|
203
|
+
```
|
204
|
+
|
205
|
+
|
206
|
+
|
81
207
|
### 試したこと
|
82
208
|
|
83
209
|
|