Bumped version to 1.5.5.

Fixed namespacing of so sorting urls.
Changed namespacing of sortable() calls.
Removed unit test to check for javascript include template, which has been eliminated.
master
Brandon Taylor 2013-09-23 08:41:10 -04:00
parent 1bf917da61
commit 8f64f6ea76
10 changed files with 11 additions and 22 deletions

View File

@ -4,9 +4,6 @@ This project makes it easy to add drag-and-drop ordering to any model in
Django admin. Inlines for a sortable model may also be made sortable,
enabling individual items or groups of items to be sortable.
## Requirements
jQuery
## Supported Django Versions
If you're using Django 1.4.x, use django-admin-sortable 1.4.9 or below.
For Django 1.5.x, use the latest version of django-admin-sortable.
@ -231,18 +228,14 @@ 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.5.4?
- Eliminated loading jQuery and jQueryUI from external CDNs.
- All jQuery-based JavaScript code now leverages the django.jQuery namespace and version of jQuery included in Django Admin.
- Eliminated needing to include jQueryUI effects core to do highlighting on drag complete.
- Added CSRF protection to sort views (thanks @dokterbob)
- Static includes now leverage {% static %} template tag.
### What's new in 1.5.5?
- Improved url resolution to sorting urls
- Fixed a potential issue with JavaScript namespace on sortable() calls that could prevent sortable from working in environments where jQuery is already included, such as Django-CMS
### Future
- Support for foreign keys that are self referential
- More unit tests
- Move unit tests out of sample project
- Move unit tests out of sample project (I could really use some help with this one)
- Travis CI integration

View File

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

View File

@ -1,7 +1,7 @@
(function($){
$(function() {
$('.sortable').sortable({
jQuery('.sortable').sortable({
axis : 'y',
containment : 'parent',
tolerance : 'pointer',

View File

@ -6,7 +6,7 @@
var sortable_inline_rows = $('.inline-group .inline-related');
sortable_inline_rows.addClass('sortable');
$('.inline-group').sortable({
jQuery('.inline-group').sortable({
axis : 'y',
containment : 'parent',
create: function(event, ui) {

View File

@ -5,7 +5,7 @@
{
var tabular_inline_rows = $('.tabular table tbody tr');
tabular_inline_rows.addClass('sortable');
$('.tabular.inline-related').sortable({
jQuery('.tabular.inline-related').sortable({
axis : 'y',
containment : 'parent',
create: function(event, ui)

View File

@ -17,7 +17,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="../sorting/do-sorting/{{ inline_admin_form.original.model_type_id }}/" />
<input type="hidden" name="admin_sorting_url" value="{% url 'admin:admin_do_sorting' inline_admin_form.original.model_type_id %}" />
{% endif %}
</div>{% endfor %}
</div>

View File

@ -41,7 +41,7 @@
{% endfor %}
{% endspaceless %}
{% if inline_admin_form.original %}
<input type="hidden" name="admin_sorting_url" value="../sorting/do-sorting/{{ inline_admin_form.original.model_type_id }}/" />
<input type="hidden" name="admin_sorting_url" value="{% url 'admin:admin_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="../sorting/do-sorting/{{ object.model_type_id }}/" class="admin_sorting_url">{{ object }}</a>
<a href="{% url 'admin:admin_do_sorting' object.model_type_id %}" class="admin_sorting_url">{{ object }}</a>

View File

@ -102,10 +102,6 @@ class SortableTestCase(TestCase):
template_names = [t.name for t in response.templates]
self.assertTrue('adminsortable/change_list.html' in template_names,
'adminsortable/change_list.html was not rendered')
self.assertTrue('adminsortable/shared/javascript_includes.html'
in template_names,
'JavaScript includes for adminsortable change list '
'were not rendered')
def test_adminsortable_change_list_sorting_fails_if_not_ajax(self):
logged_in = self.client.login(username=self.user.username,