django-tinymce

Django-TinyMCE with Multiple Forms

删除回忆录丶 提交于 2019-12-11 02:34:21
问题 I'm trying to create a single HTML page with multiple instances of TinyMCE editors. The number of editors varies by the request; so I can't enumerate them and initialize them individually. Here is my code: views.py: from tinymce.widgets import TinyMCE class ThreadForm(forms.Form): subject = forms.CharField(max_length=300, widget=forms.TextInput(attrs={'size':'100'})) body = forms.CharField(widget=TinyMCE()) class MessageForm(forms.Form): thread_pk = forms.IntegerField() body = forms.CharField

TinyMCE with Django: “This field is required”

十年热恋 提交于 2019-12-06 15:46:34
I'm currently having issues using the TinyMCE editor within the Django admin interface. When entering text into two particular TinyMCE fields and pressing save, the form is returned with both fields empty, flagged red and tagged with a "This field is required" label: This behaviour is odd, as I have implemented various TinyMCE editors within different models which have worked perfectly. I should clarify that I wish for both fields to be mandatory. The problem is that the text entered is being discarded, and the form is returned with both fields empty. Here is all of the relevant code:

Embedding tinyMCE in django flatpage

心已入冬 提交于 2019-12-06 07:11:24
I'm using django-tinymce . I'd like to know how to embed it in a flatpage in admin panel. From the project's readme: Add tinymce to INSTALLED_APPS in settings.py for your project: INSTALLED_APPS = ( ... 'tinymce', ) Add tinymce.urls to urls.py for your project: urlpatterns = patterns('', ... (r'^tinymce/', include('tinymce.urls')), ) My flatpage url : url(r'^pages/', include('django.contrib.flatpages.urls')), you need to override the widget for the content field. To do this: extend the FlatpageForm ModelForm as PageForm extend the FlatPageAdmin to use the new PageForm code example: from django

TinyMCE - Pass value from Popup

情到浓时终转凉″ 提交于 2019-12-05 02:45:18
问题 I am using TinyMCE . On a Click I am opening an inline popup successfully.But I have no idea how I can pass a value from popup to tinyMCE.Any help highly appreciated. tinyMCE.activeEditor.windowManager.open({ file : "options.jsp", title : 'Image Manager', width : 800, height : 600, resizable : "yes", inline : "yes", close_previous : "no", win : window }); 回答1: Took me some time to find it out myself. It is not that difficult. To insert HTML to your editor from the popup you may use something

Django Grappelli Tabular Inline add new row TinyMCE textfield not editable

杀马特。学长 韩版系。学妹 提交于 2019-12-03 12:20:58
I am using django Grappelli skin for my project. I have a ModelAdmin with tabular inline function. I use extra = 0 to prevent auto insert blank row, when the page is loaded. It works fine. Now, when I click on the + sign to insert new row, the row is loaded, but the tinymce textfield is not editable. Anyone know what is the reasons and how to solve this problem? After reading the document: http://django-grappelli.readthedocs.org/en/latest/customization.html#using-tinymce I notice: Using TinyMCE with Inlines is a bit more tricky because of the hidden empty-form. You need to write a custom