You could do: {% if object.player_set.all %} {% else %} No players currently registered. {% endif %}
On 2/25/07, DuncanM <[EMAIL PROTECTED]> wrote: > > > <h2>Registered Players</h2> > <ul> > {% for player in object.player_set.all %} > <li>{{ player.forename }} {{ player.surname }} > ({{ player.age }})</li> > {% endfor %} > {% if object.player_set.all == "" %} > No players currently registered > {% endif %} > </ul> > > > Request Method: GET > Request URL: http://duncanm.webfactional.com/teams/1/ > Exception Type: TemplateSyntaxError > Exception Value: 'if' statement improperly formatted > Exception Location: /home2/duncanm/lib/python2.4/django/template/ > defaulttags.py in do_if, line 608 > > I know this is a very stupid question but from my code above I get > that error (also above). What is the correct way of using an if > statement to display some text if object.player_set.all is empty?? > > Thanks > > > > > -- Matt H <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---