hi john - you can use the 'spaceless' tag in your template: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#spaceless
to filter out spaces & carriage returns. -jake On Mon, Feb 2, 2009 at 3:41 PM, John M <retireonc...@gmail.com> wrote: > > Grrr, I answered my own quesiton, if I remove all the CR's from the > template, then it's OK. > > So changing the template to > > {% if object_list %}{% for obj in object_list %}{{ obj.name }}{% > endfor %}{% endif %} > > Works like I want. But now, how can I not have the CR's in the > template effect my output? > > Thanks > > > On Feb 2, 12:57 pm, John M <retireonc...@gmail.com> wrote: >> 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 django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---