romanvm / django-tinymce4-lite

TinyMCE 4 editor widget for Django
MIT License
126 stars 47 forks source link

attributes not working if implemented with formfield_overrides #38

Closed retosteffen closed 6 years ago

retosteffen commented 6 years ago

I wanted to add tinymce in my admin forms without having to change the model and implementing it like this:

from tinymce.widgets import TinyMCE
from django.db import models

class EventAdmin(admin.ModelAdmin):
    formfield_overrides = {
        models.TextField: {'widget': TinyMCE(attrs={'cols': 10, 'rows': 30})},
    }
admin.site.register(Event, EventAdmin)

works but the attributes are overwritten with the ones from my settings.py file. Is there a way to use this with formfield_overrides or do I have to change all my model fields?

retosteffen commented 6 years ago

sorry was looking for TinyMCE(mce_attrs = instead of TinyMCE(attrs=