I'm just trying to associate each vm tied to the customers id and display 
the vms under the customer that are associated with his id.

On Monday, May 12, 2014 3:02:34 PM UTC-6, G Z wrote:
>
> Views.py
>
>
> from django.shortcuts import render
> from django.http import HttpResponse
> from vmware.models import Customer
> from django.shortcuts import render_to_response
> from vmware.models import Vms
>
> def index(request):
>         customers = Customer.objects.all
>         vms = Vms.objects.all
>         ctx = { 'customers':customers, 'vms':vms}
>         return render_to_response('index.html', ctx)
>
>
> index.html
>
>
> {% for e in customers %}
>         {% for d in vms %}
>                 {% if e.NAME == d.CUSTOMERID %}
>                         <div> {{ e.id }} - {{ e.NAME }} - {{ d.VMNAME }}     
> </div>
>                 {% endif %}
>
>
>                 <br><hr>
>                 <center>Test Data </center>
>                 <a href='/{{e.id}}'>e.name - {{ e.NAME }}</a><br>
>
>                                 d.customerid - {{ d.CUSTOMERID }}
>
>
>         {% endfor %}
> {% endfor %}
>
>
> The section for test data will display but the section under the iff 
> statement wont and there are values that match exactly.
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/0b78b42e-dc8c-46f4-adbc-60e116dfe2cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to