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 <zuk...@gmail.com>:

> 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 = Vms.objects.all
>         ctx = { 'customers':customers, 'vms':vms}
>         return render_to_response('index.html', ctx)
>
> my views.py
>
> the loop now reads
>
>         {% for e in customers %}
>                 {% for e in vms %}
>                         {% if e.VMIDS = e.id %}
>                                 <div> {{ e.id }} - {{ e.NAME }} - {{
> e.VMNAME }}     </div>
>                         {% endif %}
>                 {% endfor %}
>         {% endfor %}
>
>
>
>  --
> 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/0e8117da-c6b0-4930-aebd-534124e025a5%40googlegroups.com<https://groups.google.com/d/msgid/django-users/0e8117da-c6b0-4930-aebd-534124e025a5%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAJJc_8Vo29_hW%2BWxPEoaOje-4Hjft-EpZVcjb8DcvzqufhimTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to