Using django-suit and SortableModelAdmin/SortableTabularInline, it is possible to sort objects in the admin interface's changlelist view and sort inlines, provided that a sortable attribute is provided ('order' by default in django-suit).
class CustomServiceProductBindingInline(suit.admin.SortableTabularInline):
model = Product.bound_services.through
verbose_name = _("attached services")
sortable = 'order'
class ProductModelAdmin(suit.admin.SortableModelAdmin):
model = Product
sortable = 'order'
inlines = [CustomServiceProductBindingInline,]
But...
But django-suit cannot handle nested inlines, so I integrated properly the django-nested-admin application in my web app and it works like a charm. I had to switch my ModelAdmins from suit.admin.SortableModelAdmin to nested_Admin.NestedModelAdmin and switch my inlines from suit.admin.SortableTabularInline to nested_Admin.NestedTabularInline...
and the nested inlines work fine....
The problem is : with django-nested-admin, my ModelAdmin cannot be sorted in the changelist view anymore ! Is there a way to implement it ? Is this a compatibility issue with django-suit ? Or simply is it not implemented in django-nested-admin ?
class CustomServiceProductBindingInline(nested_admin.NestedTabularInline):
model = Product.bound_services.through
verbose_name = _("attached services")
sortable_field_name = "order"
class ProductModelAdmin(nested_admin.NestedModelAdmin):
model = Product
sortable_field_name = 'order'
sortable = 'order' # Does not work anymore
sortable_field_name = "order" # Apparently ignored too...
inlines = [CustomServiceProductBindingInline,]
Django-suit was great...
Using
django-suit
and SortableModelAdmin/SortableTabularInline, it is possible to sort objects in the admin interface's changlelist view and sort inlines, provided that a sortable attribute is provided ('order' by default indjango-suit
).But...
But
django-suit
cannot handle nested inlines, so I integrated properly thedjango-nested-admin
application in my web app and it works like a charm. I had to switch my ModelAdmins from suit.admin.SortableModelAdmin to nested_Admin.NestedModelAdmin and switch my inlines from suit.admin.SortableTabularInline to nested_Admin.NestedTabularInline...and the nested inlines work fine....
The problem is : with
django-nested-admin
, my ModelAdmin cannot be sorted in the changelist view anymore ! Is there a way to implement it ? Is this a compatibility issue withdjango-suit
? Or simply is it not implemented indjango-nested-admin
?