Re: Python Nested For Looping MultiTable Association Question

2014-05-08 Thread G Z
outside the if statement the data appears.. -- 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, sen

Re: Python Nested For Looping MultiTable Association Question

2014-05-08 Thread G Z
{% for e in customers %} {% for d in vms %} {% if e.id = d.CUSTOMERID %} {{ e.id }} - {{ e.NAME }} - {{ d.VMNAME }} {% endif %} {% endfor %} {% endfor %} why doesn't this work.? -- You rec

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread G Z
by the way if someone could help me understand what the docs are saying about doing this in views that would be awesome. On Wednesday, May 7, 2014 11:35:21 AM UTC-6, G Z wrote: > > I'm new to django so im assuming there is an easier way to do this but in > my html template im trying to do the fo

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread G Z
ok so I added == to my if statement and independently verified that the values were displaying and are correct. So I was wrong though .id is not .CUSTOMERID because I returned self.name for the customer model it needs to match the strings so i have {% for e in customers %}

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread Sylvain GROS-DESORMEAUX
use == instead of = in your if statement. On Wed, May 7, 2014 at 4:18 PM, G Z wrote: > out of my stupidity i refined it a bit > > {% for e in customers %} > {% for d in vms %} > {% if e.id = d.CUSTOMERID %} > {{

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread G Z
I read that but didn't quite get how to return the values the way I want.. On Wednesday, May 7, 2014 11:35:21 AM UTC-6, G Z wrote: > > I'm new to django so im assuming there is an easier way to do this but in > my html template im trying to do the following > > I have a customer that has vmids a

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread Rafael E. Ferrero
https://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-all-objects -- Rafael E. Ferrero 2014-05-07 16:54 GMT-03:00 G Z : > I don't know why this isn't working.. > > > from django.shortcuts import render > from django.http import HttpResponse > from vmware.models import Customer > f

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread G Z
out of my stupidity i refined it a bit {% for e in customers %} {% for d in vms %} {% if e.id = d.CUSTOMERID %} {{ e.id }} - {{ e.NAME }} - {{ d.VMNAME }} {% endif %} {% e

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread G Z
I don't know why this isn't working.. 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

Python Nested For Looping MultiTable Association Question

2014-05-07 Thread G Z
I'm new to django so im assuming there is an easier way to do this but in my html template im trying to do the following I have a customer that has vmids associated with that and i want to match up every vm in the table vms by id to the vmids tag associated with the customer and display each on