Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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}
}
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)