Skip to content
Snippets Groups Projects
Commit 06bfe426 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Add parent to items table

parent 34843baa
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,7 @@ def retrieve_items(): ...@@ -53,6 +53,7 @@ def retrieve_items():
utils.format_field(item.model), utils.format_field(item.model),
utils.format_field(item.location), utils.format_field(item.location),
utils.format_field(item.status), utils.format_field(item.status),
utils.format_field(item.parent),
] for item in items] ] for item in items]
return jsonify(data=data) return jsonify(data=data)
......
...@@ -19,7 +19,7 @@ $(document).ready(function() { ...@@ -19,7 +19,7 @@ $(document).ready(function() {
"searchable": false "searchable": false
}, },
{ {
"targets": [1], "targets": [1, 9],
"render": function(data, type, row) { "render": function(data, type, row) {
// render funtion to create link to Item view page // render funtion to create link to Item view page
if ( data === null ) { if ( data === null ) {
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<th>Model</th> <th>Model</th>
<th>Location</th> <th>Location</th>
<th>Status</th> <th>Status</th>
<th>Parent</th>
</tr> </tr>
</thead> </thead>
</table> </table>
......
...@@ -82,4 +82,4 @@ def test_retrieve_items(logged_client, session): ...@@ -82,4 +82,4 @@ def test_retrieve_items(logged_client, session):
response = get(logged_client, '/_retrieve_items') response = get(logged_client, '/_retrieve_items')
items = response.json['data'] items = response.json['data']
assert set(serial_numbers) == set(item[4] for item in items) assert set(serial_numbers) == set(item[4] for item in items)
assert len(items[0]) == 9 assert len(items[0]) == 10
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment