I'm trying to use the generic views and templates to get a very simple
text output of records.
I don't want HTML, but need them available from a command line (via
curl).
Here's my URL setup.
newhosts_dict = {
'queryset' : unixhost.objects.all().filter(hostsetting__userlist =
False)
}
urlspatterns...
(r'^likewise/newhosts/$',
'django.views.generic.list_detail.object_list', newhosts_dict),
here's the template:
{% if object_list %}
{% for obj in object_list %}
{{ obj.name }}
{% endfor %}
{% endif %}
If the queryset only has 1 record in it, why do I have three lines in
my output? 1 blank, 1 record output, and one 1 blank.
thoughts?
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---