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 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 one for each customer and eventually vmspecs are 
> going to be tied to the vmid. I have my models.py and my index.html can 
> anyone help me understand wahts wrong
>
>
> <html>
>> <head>
>> <title>Customres</title>
>> </head>
>> <boody>
>> <p>Index Page</p>
>>         {% for e in customers %}
>>                 {% for v in vms %}
>>                         {% if e.VMIDS = v.id %}
>>                                 <div> {{ e.id }} - {{ e.NAME }} - {{ 
>> v.VMNAME }}     </div>
>>                         {% endif %}
>>                 {% endfor %}
>>         {% endfor %}
>> </body>
>> </html>
>
>
>
>
>
> class Customer(models.Model):
>>     NAME = models.CharField(max_length=200)
>>     WEBSITE = models.CharField(max_length=200)
>>     PHONE = models.CharField(max_length=200)
>>     EMAIL = models.CharField(max_length=200)
>>     ADDRESS = models.CharField(max_length=200)
>>     VMIDS = models.CharField(max_length=200)
>>     def __unicode__(self):
>>         return self.NAME
>> class Vms(models.Model):
>>     VMNAME = models.CharField(max_length=200)
>>     VMSTATUS = models.CharField(max_length=200)
>>     CUSTOMERID = models.ForeignKey(Customer)
>>     def __unicode__(self):
>>         return self.VMNAME
>> class Vmspecs(models.Model):
>>     CPUS =  models.CharField(max_length=200)
>>     CORES =  models.CharField(max_length=200)
>>     MEMORY =  models.CharField(max_length=200)
>>     HDSPACE =  models.CharField(max_length=200)
>>     OS =  models.CharField(max_length=200)
>>     UPTIME = models.CharField(max_length=200)
>>     VMID  = models.ForeignKey(Vms)
>>     CUSTOMERID = models.ForeignKey(Customer)
>>     def __unicode__(self):
>>        return self.VMID
>
>

-- 
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/900ab03a-b0ff-44a5-837c-f67dd1d222c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to