I would like to add some very basic rich text editing in my charfields, only bold, italic and a custom fontsize selector (small-normal-large -- relative to another model field setting). At first I tried to use django-tinymce, but when using a formset I had some problems that the media files for tinymce only applied to the first form in the set, and my added js function doesnt work. Maybe I need a custom widget for this small-normal-large fontsize selector anyway (or do this as a model field).
Is it recommendable to user TinyMCE and try to customize it in this case (if so, how), or is there a more straightforward way to go using the form I've already created?
Here's what I have in my form (dynamically changing the textarea size, and calling js function in the template to limit chars):
text=forms.CharField(max_length = 1000, widget=forms.widgets.Textarea())
def __init__(self, *args, **kwargs):
size = kwargs.pop('size')
maxChars = kwargs.pop('maxChars')
super(MyForm, self).__init__(*args, **kwargs)
self.fields['text'].widget.attrs['onkeypress'] = 'return textCounter(this, this.form.counter, %d);' % maxChars
self.fields['text'].widget.attrs['rows'] = size
self.fields['text'].widget.attrs['cols'] = '40'