Working on #12
This commit is contained in:
parent
520f9101c1
commit
93ba6babbd
9
app.py
9
app.py
@ -431,6 +431,14 @@ def missing():
|
|||||||
cursor.close()
|
cursor.close()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
color_file = np.loadtxt("colors.csv",delimiter=",",dtype="str")
|
||||||
|
|
||||||
|
color_dict = {str(code): name for code, name, _, _ in color_file}
|
||||||
|
|
||||||
|
for item in missing_list:
|
||||||
|
color_code = str(item[1])
|
||||||
|
if color_code in color_dict:
|
||||||
|
item[1] = color_dict[color_code]
|
||||||
|
|
||||||
return render_template('missing.html',missing_list=missing_list)
|
return render_template('missing.html',missing_list=missing_list)
|
||||||
|
|
||||||
@ -445,7 +453,6 @@ def parts():
|
|||||||
cursor.close()
|
cursor.close()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
|
||||||
return render_template('parts.html',missing_list=missing_list)
|
return render_template('parts.html',missing_list=missing_list)
|
||||||
|
|
||||||
@app.route('/minifigs',methods=['POST','GET'])
|
@app.route('/minifigs',methods=['POST','GET'])
|
||||||
|
@ -102,7 +102,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th ></th>
|
<th ></th>
|
||||||
<th >part_num</th>
|
<th >part_num</th>
|
||||||
<th >color_id</th>
|
<th >color</th>
|
||||||
<th >element_id</th>
|
<th >element_id</th>
|
||||||
<th >total_quantity</th>
|
<th >total_quantity</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -118,7 +118,7 @@
|
|||||||
<td>{{ brick[0] }}</td>
|
<td>{{ brick[0] }}</td>
|
||||||
<td>{{ brick[1] }}</td>
|
<td>{{ brick[1] }}</td>
|
||||||
<td>{{ brick[2] }}</td>
|
<td>{{ brick[2] }}</td>
|
||||||
<td>{{ brick[4] }}</td>
|
<td>{{ brick[3] }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
Loading…
Reference in New Issue
Block a user