darklow / django-suit-redactor

Imperavi Readactor (WYSIWYG editor) integration app for Django admin
26 stars 21 forks source link

SortableTabularInline conflict #4

Open paulshannon opened 10 years ago

paulshannon commented 10 years ago

When you use a RedactorWidget in a SortableTabularInline and the SortableTabularInline items get re-ordered, the item that gets reordered no longer displays the content of the RedactorWidget (but appears to allow you to change it).

class QuestionForm(ModelForm):
    model = Question

    class Meta:
        widgets = {
            'html': RedactorWidget(editor_options={'lang': 'en'})
        }

class QuestionInline(SortableTabularInline):
    model = Question
    form = QuestionForm
    sortable = 'order'

class TestForm(ModelForm):
    model = Test

class TestAdmin(ModelAdmin):
    form = TestForm
    inlines = (QuestionInline,)
admin.site.register(Test, TestAdmin)