How to use the martor.fields.MartorFormField function in martor

To help you get started, we’ve selected a few martor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github agusmakmun / django-markdown-editor / martor_demo / app / forms.py View on Github external
from django import forms

from martor.fields import MartorFormField
from app.models import Post


class SimpleForm(forms.Form):
    title = forms.CharField(widget=forms.TextInput())
    description = MartorFormField()
    wiki = MartorFormField()


class PostForm(forms.ModelForm):

    class Meta:
        model = Post
        fields = '__all__'
github agusmakmun / django-markdown-editor / martor / fields.py View on Github external
def __init__(self, *args, **kwargs):

        # to setup the editor without label
        if not MARTOR_ENABLE_LABEL:
            kwargs['label'] = ''

        super(MartorFormField, self).__init__(*args, **kwargs)

        if not issubclass(self.widget.__class__, MartorWidget):
            self.widget = MartorWidget()
github agusmakmun / django-markdown-editor / martor_demo / app / forms.py View on Github external
from django import forms

from martor.fields import MartorFormField
from app.models import Post


class SimpleForm(forms.Form):
    title = forms.CharField(widget=forms.TextInput())
    description = MartorFormField()
    wiki = MartorFormField()


class PostForm(forms.ModelForm):

    class Meta:
        model = Post
        fields = '__all__'