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.
This commit is contained in:
@@ -210,7 +210,7 @@ class SortableAdmin(SortableAdminBase, ModelAdmin):
|
|||||||
"""
|
"""
|
||||||
if request.is_ajax() and request.method == 'POST':
|
if request.is_ajax() and request.method == 'POST':
|
||||||
try:
|
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()
|
klass = ContentType.objects.get(id=model_type_id).model_class()
|
||||||
objects_dict = dict([(str(obj.pk), obj) for obj in
|
objects_dict = dict([(str(obj.pk), obj) for obj in
|
||||||
klass.objects.filter(pk__in=indexes)])
|
klass.objects.filter(pk__in=indexes)])
|
||||||
|
|||||||
Reference in New Issue
Block a user