Merge pull request #37 from gugu/master

Python 3 support for indexes posted in do_sortting_view. map in Python3 returns an instance of Map instead of a list.
master
Brandon Taylor 2013-05-11 07:34:49 -07:00
commit 724f073f38
1 changed files with 1 additions and 1 deletions

View File

@ -210,7 +210,7 @@ class SortableAdmin(SortableAdminBase, ModelAdmin):
"""
if request.is_ajax() and request.method == 'POST':
try:
indexes = map(str, request.POST.get('indexes', []).split(','))
indexes = list(map(str, request.POST.get('indexes', []).split(',')))
klass = ContentType.objects.get(id=model_type_id).model_class()
objects_dict = dict([(str(obj.pk), obj) for obj in
klass.objects.filter(pk__in=indexes)])