descripcion reportes

parent a6142606
......@@ -536,6 +536,7 @@
data: {'title': label},
url: '../administration/ws/report_table',
success: function (data) {
console.log("hola");
$('#mostrar').empty();
$('#mostrar').append("<table class=\"table table-hover\" id=\"example\">"+
......
......@@ -69,7 +69,7 @@ def Dashboard(request):
count=Count('search_name')).order_by('-count')[:5]
# Espacio Usado en Sentinel #
'''
bytes_size = 0
for path, directories, files in os.walk(USERS_PATH + "sentinelImages"):
for filename in files:
......@@ -90,7 +90,7 @@ def Dashboard(request):
bytes_size += os.lstat(os.path.join(path, directory)).st_size
bytes_size += os.path.getsize(USERS_PATH + "repsat_test_dev")
size_repsat = best_unit_size(bytes_size)
'''
......@@ -176,14 +176,15 @@ def wsPurchasesPM(request):
for user in data:
bytes_size = 0
for path, directories, files in os.walk(PATH_USERS+user['user__email']):
for filename in files:
bytes_size += os.lstat(os.path.join(path, filename)).st_size
for directory in directories:
bytes_size += os.lstat(os.path.join(path, directory)).st_size
bytes_size += os.path.getsize(PATH_USERS+user['user__email'])
storage = best_unit_size(bytes_size)
#for path, directories, files in os.walk(PATH_USERS+user['user__email']):
# for filename in files:
# bytes_size += os.lstat(os.path.join(path, filename)).st_size
# for directory in directories:
# bytes_size += os.lstat(os.path.join(path, directory)).st_size
#bytes_size += os.path.getsize(PATH_USERS+user['user__email'])
#storage = best_unit_size(bytes_size)
storage = 0
pending = Purchase.objects.filter(user_id=user['user_id'],aggreg_date__month=to_if(request.POST.get('title'))).exclude(progress=100).annotate(dcount=Count('progress'))
......@@ -195,6 +196,7 @@ def wsPurchasesPM(request):
'storage':storage,
'in_process': pending.count(),
})
print (table_data)
return HttpResponse(json.dumps(table_data))
else:
raise Http404
......
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