so as you can see when ever the vm field customer id matches the customers name i want to display the vm with the customer. To create a table of vms that each customer has. I also will be associating a third database with vmspecs to each vm.
I know there is an easier way to do this with django but i didn't quite understand waht the documentation was sayign 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/63db923d-905d-4cf9-ba8b-41efdacf9dc5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.