shouldn't this work? After doing some more research into making django 
queries faster and more efficient I came 
across, http://tech.yipit.com/2013/01/20/making-django-orm-queries-faster/
I'm using thier method from what I understand you can selec_related to a 
primary key field and query like such, and it is the same as doing a join 
building a query set based on your parameters.


my html is 

    {% for item in customer %}
    <tr> 
        <td>{{ item.customer_id }}</td>
        
        <td><a href="{{ item.customer_id }}">{{ item.customer_name }}</a>
        {{ vm_groups.customer_id.vm_group_name }}
        {{ vms.vm_group_id.vm_name }}
        
        
        </td>
    </tr>
    {% endfor %}


my view code:

def portal(request):
    
    query_results = Customer.objects.all()
    vm_groups = Vm_group.objects.all().select_related('customer_id') 
    vms =  Vm.objects.all().select_related('vm_group_id')   


    context = Context({'customer': query_results, 'vm_groups':vm_groups, 
'vms':vms,
                                                })

    return render(request, 'portal.html', context)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e61cb11e-0461-4e24-83b6-e6dd77d8ad93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to