This file is used to print out the name of the premises with an update link , however I wanted to add a list of premises with the in_use flag set to false.
Can anyone tell me what I am doing wrong?
{% extends "base.html" %}
{% block content %}
<h2>Premises</h2>
<ul>
{% unusedpremises = [] %}
{% for premises in object_list %}
{% if premises.in_use %}
<li>{{ premises.name }} <a href ="premuv/{{premises.id}}/"> Update </a>   </li>
{% else unusedpremises.add(premises) %}
{% endif %}
{% endfor %}
</ul>
<h3>Unused Premises</h3>
<ul>
{% for premises in unusedpremises %}
<li>{{ premises.name }} <a href ="premuv/{{premises.id}}/"> Update </a> %nbsp </li>
{% endif %}
{% endfor %}
</ul>
{% endblock %}
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+unsubscribe@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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment