Commit 9b1d7a5d authored by Marc Duez's avatar Marc Duez

server : user files stat

parent 48d2570a
......@@ -10,7 +10,16 @@ def index():
query = db(db.auth_user).select()
for row in query :
row.created_patient = db( db.patient.creator == row.id ).count()
row.created = db( db.patient.creator == row.id ).count()
row.size = 0
row.files = 0
query_size = db( db.sequence_file.provider == row.id ).select()
for row2 in query_size:
row.files += 1
row.size += row2.size_file
return dict(query=query)
## return user information
......
{{extend 'db_layout.html'}}
{{import vidjil_utils}}
<div>
<h3>User info</h3>
......@@ -8,7 +9,8 @@
<thead>
<tr><td class="column1"> user name</td>
<td> @</td>
<td class="colum1">created patient</td>
<td class="colum1">patients created </td>
<td class="colum1">files provided </td>
</tr>
</thead>
......@@ -16,7 +18,8 @@
<tr onclick="db.call('user/info', {'id' :'{{=row.id}}'} )">
<td> {{=row.first_name + " " + row.last_name }} </td>
<td> {{=row.email}} </td>
<td> {{=row.created_patient}} </td>
<td> {{=row.created}} </td>
<td> {{=row.files}} ({{=vidjil_utils.format_size(row.size)}}) </td>
</tr>
{{pass}}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment