How to use the martor.widgets.AdminMartorWidget 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 / admin.py View on Github external
from django.contrib import admin
from django.db import models

from .widgets import AdminMartorWidget
from .models import MartorField


class MartorModelAdmin(admin.ModelAdmin):

    formfield_overrides = {
        MartorField: {'widget': AdminMartorWidget}
    }
github agusmakmun / django-markdown-editor / martor_demo / app / admin.py View on Github external
from django.db import models
from django.contrib import admin

from martor.widgets import AdminMartorWidget
from martor.models import MartorField

from app.models import Post


class PostAdmin(admin.ModelAdmin):
    list_display = ['title', 'id']
    formfield_overrides = {
        MartorField: {'widget': AdminMartorWidget},
        models.TextField: {'widget': AdminMartorWidget},
    }

admin.site.register(Post, PostAdmin)