mapa en modal

parent 8d41936c
...@@ -235,10 +235,10 @@ def wsProcessProgress(request): ...@@ -235,10 +235,10 @@ def wsProcessProgress(request):
progress = 60 progress = 60
if 'Finalizing...' in open(log_info).read(): if 'Finalizing...' in open(log_info).read():
progress = 100 progress = 100
item = Purchase.objects.get(pk=producto['id']) #item = Purchase.objects.get(pk=producto['id'])
item.progress = progress #item.progress = progress
item.save() #item.save()
productList2.append({ productList2.append({
"purchase_id": producto['id'], "purchase_id": producto['id'],
......
{% load staticfiles %} {% load staticfiles %}
{% for data in user_data %}
<div class="col-md-3"> <div class="col-md-3">
<!-- Profile Image --> <!-- Profile Image -->
<div class="box box-primary"> <div class="box box-primary">
<div class="box-body box-profile"> <div class="box-body box-profile">
<img class="profile-user-img img-responsive img-circle" src="{% static 'users/images/user_default.png' %}" <img class="profile-user-img img-responsive img-circle" src="{% static 'users/images/user_default.png' %}"
alt="User profile picture"> alt="User profile picture">
<h3 class="profile-username text-center">{{ data.user_fullname }}</h3>
<h3 class="profile-username text-center">{{ user.get_full_name }}</h3>
<p class="text-muted text-center">Software Engineer</p> <p class="text-muted text-center">Software Engineer</p>
<ul class="list-group list-group-unbordered"> <ul class="list-group list-group-unbordered">
<li class="list-group-item"> <li class="list-group-item">
<b>Searches</b> <a class="pull-right">1,322</a> <b>Searches</b> <a class="pull-right">{{ data.searches }}</a>
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<b>Purchases</b> <a class="pull-right">543</a> <b>Purchases</b> <a class="pull-right">{{ data.purchases }}</a>
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<b>In Process</b> <a class="pull-right">13,287</a> <b>In Process</b> <a class="pull-right">{{ data.in_process }}</a>
</li> </li>
</ul> </ul>
...@@ -70,4 +70,5 @@ ...@@ -70,4 +70,5 @@
<!-- /.box-body --> <!-- /.box-body -->
</div> </div>
<!-- /.box --> <!-- /.box -->
</div> </div>
\ No newline at end of file {% endfor %}
\ No newline at end of file
from django.contrib.auth.models import User
from django.shortcuts import render from django.shortcuts import render
# Create your views here. # Create your views here.
from catalog.models import Search, Purchase
def Users(request): def Users(request):
user_data = []
user = User.objects.get(pk=request.user.id)
searches = Search.objects.filter(user_id=user.id)
purchases = Purchase.objects.filter(user_id=user.id)
in_process = Purchase.objects.filter(user_id=user.id).exclude(progress=100)
print(searches.count())
user_data.append({
"user_fullname": user.first_name+" "+user.last_name,
"searches": searches.count(),
"purchases": purchases.count(),
"in_process": in_process.count(),
})
return render(request,'User_profile.html') return render(request,'User_profile.html',{"user_data" : user_data} )
\ No newline at end of file \ No newline at end of file
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