Removed url template tags and put in relative paths for sorting urls for Django <= 1.4.x and Django 1.5.x compatibility.

master
Brandon Taylor 2013-04-27 13:10:53 -04:00
parent 373197553e
commit b6e68fa367
7 changed files with 11 additions and 10 deletions

View File

@ -162,8 +162,9 @@ ordering on top of that just seemed a little much in my opinion.
django-admin-sortable is currently used in production.
### What's new in 1.4.3?
- Reverted changes that broke getting the sorting url for inlines
### What's new in 1.4.4?
- Decided to go with the simplest approach to add the sorting urls to inlines
for Django <= 1.4 and Django 1.5.x support
### Future

View File

@ -1,4 +1,4 @@
VERSION = (1, 4, 3) # following PEP 386
VERSION = (1, 4, 4) # following PEP 386
DEV_N = None

View File

@ -45,10 +45,10 @@
{% block object-tools %}
<ul class="object-tools">
<li>
<a href="../">
{% blocktrans with opts.verbose_name_plural|capfirst as model %}Return to {{ model }}{% endblocktrans %}
</a>
</li>
<a href="../">
{% blocktrans with opts.verbose_name_plural|capfirst as model %}Return to {{ model }}{% endblocktrans %}
</a>
</li>
</ul>
{% endblock %}
{% if objects %}

View File

@ -16,7 +16,7 @@
{% if inline_admin_form.has_auto_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
{{ inline_admin_form.fk_field.field }}
{% if inline_admin_form.original %}
<input type="hidden" name="admin_sorting_url" value="{% url admin:admin_do_sorting inline_admin_form.original.model_type_id %}" />
<input type="hidden" name="admin_sorting_url" value="../sorting/do-sorting/{{ inline_admin_form.original.model_type_id }}/" />
{% endif %}
</div>{% endfor %}
</div>

View File

@ -40,7 +40,7 @@
{% endfor %}
{% endspaceless %}
{% if inline_admin_form.original %}
<input type="hidden" name="admin_sorting_url" value="{% url admin:admin_do_sorting inline_admin_form.original.model_type_id %}" />
<input type="hidden" name="admin_sorting_url" value="../sorting/do-sorting/{{ inline_admin_form.original.model_type_id }}/" />
{% endif %}
</td>
{% for fieldset in inline_admin_form %}

View File

@ -3,4 +3,4 @@
<form>
<input name="pk" type="hidden" value="{{ object.pk }}" />
</form>
<a href="{% url admin:admin_do_sorting object.model_type_id %}" class="admin_sorting_url">{{ object }}</a>
<a href="../sorting/do-sorting/{{ object.model_type_id }}/" class="admin_sorting_url">{{ object }}</a>