CKEditor Django with TextInput instead of TextArea

326 views Asked by At

I'm using CKEditor in my Django admin and for example for a specific form I used:

class ChoiceForm(forms.ModelForm):
    text = forms.CharField(widget=CKEditorWidget())
    class Meta:
        model = Choice
        fields = '__all__'

With the correct configurations in my settings.py, it works fine. The problem now is that the text field is a textArea and I would like to have an TextInput instead. Before of using CKEditor the field was like this:

text=forms.CharField(label='Name', max_length=100,
                               widget=forms.TextInput(attrs={'size': '20'}))

How can I make what I need, use CKEditor as a TextInput and with a specific size?

0

There are 0 answers