<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
I don't know why this isn't working..from django.shortcuts import renderfrom django.http import HttpResponsefrom vmware.models import Customerfrom django.shortcuts import render_to_responsefrom vmware.models import Vmsdef index(request):
customers = Customer.objects.all()
--To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0e8117da-c6b0-4930-aebd-534124e025a5%40googlegroups.com.
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
--
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...@googlegroups.com.
To post to this group, send email to django...@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/92670fc0-31f0-4d26-91a0-f84560a6991c%40googlegroups.com.