質問編集履歴
1
コードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -41,4 +41,39 @@
|
|
41
41
|
db.session.commit()
|
42
42
|
return redirect('/')
|
43
43
|
else:
|
44
|
-
return render_template('create.html')
|
44
|
+
return render_template('create.html')
|
45
|
+
```
|
46
|
+
|
47
|
+
```index.html
|
48
|
+
{% extends 'bootstrap/base.html' %}
|
49
|
+
{% block title %}タイトル
|
50
|
+
{% endblock %}
|
51
|
+
{% block content %}
|
52
|
+
<div class="container">
|
53
|
+
<h2>累計</h2>
|
54
|
+
{{ t_return }}
|
55
|
+
<table class="table">
|
56
|
+
<thead>
|
57
|
+
<tr>
|
58
|
+
<th scope="col">No</th>
|
59
|
+
<th scope="col">Date</th>
|
60
|
+
<th scope="col">Kinds</th>
|
61
|
+
<th scope="col">Invest</th>
|
62
|
+
<th scope="col">Return</th>
|
63
|
+
</tr>
|
64
|
+
</thead>
|
65
|
+
{% for post in posts %}
|
66
|
+
<tbody>
|
67
|
+
<tr>
|
68
|
+
<th scope="row">{{ post.id }}</th>
|
69
|
+
<td>{{ post.date }}</td>
|
70
|
+
<td>{{ post.kinds }}</td>
|
71
|
+
<td>¥{{ post.invest }}</td>
|
72
|
+
<td>¥{{ post.return_ }}</td>
|
73
|
+
|
74
|
+
</tr>
|
75
|
+
</tbody>
|
76
|
+
{% endfor %}
|
77
|
+
{% endblock %}
|
78
|
+
|
79
|
+
```
|