Updated version to 1.3.2.

Updated status to stable/production.
Added AttributeError exception handling for models that specify a SortableForeignKey that does not inherit from Sortable.
Added template support for nested objects that are sortable by a foreign key, where the foreign key is not sortable.
This commit is contained in:
Brandon Taylor
2012-06-07 09:38:36 -04:00
parent 7a000f1724
commit 484f00d263
7 changed files with 32 additions and 17 deletions
@@ -1,6 +1,12 @@
{% load adminsortable_tags %}
{% for object in list_objects %}
<li>
{% render_object_rep object %}
</li>
{% endfor %}
{% with list_objects_length=list_objects|length %}
{% for object in list_objects %}
<li>
{% if list_objects_length > 1 %}
{% render_object_rep object %}
{% else %}
{{ object }}
{% endif %}
</li>
{% endfor %}
{% endwith %}
@@ -5,12 +5,18 @@
{% for regrouped_object in regrouped_objects %}
<li>
{% with object=regrouped_object.grouper %}
{% render_object_rep object %}
{% if sortable_by_class_is_sortable %}
{% render_object_rep object %}
{% else %}
{{ object }}
{% endif %}
{% endwith %}
{% if regrouped_object.list %}
<ul {% if regrouped_object.grouper.is_sortable %}class="sortable"{% endif %}>
{% with regrouped_object_list_length=regrouped_object.list|length %}
<ul {% if regrouped_object_list_length > 1 %}class="sortable"{% endif %}>
{% render_list_items regrouped_object.list %}
</ul>
{% endwith %}
{% endif %}
</li>
{% endfor %}