{% extends "admin/edit_inline/tabular.html" %}
{% block extrastyle %}
{{ block.super }}
<style>
/* Add any additional styles if needed */
</style>
{% endblock %}
{% block contents %}
<div class="inline-related{% if forloop.last %} last-related{% endif %}">
{{ inline_admin_formset.formset.management_form }}
{% for form in inline_admin_formset.forms %}
{% include "admin/includes/fieldset.html" %}
<div class="form-row{% if forloop.last %} add-row{% endif %}{% if inline_admin_formset.can_delete %}{% if form.original or form.show_url %} stacked{% else %} tabular{% endif %}{% endif %}">
{% for fieldset in inline_admin_formset %}
{% for line in fieldset %}
{% for field in line %}
{% if field.name %}
<td class="field-{{ field.name }}{% if field.widget.attrs.class == 'ckeditor' %} ckeditor{% endif %}{% if field.errors %} errors{% endif %}">
{% else %}
<td{% if field.errors %} class="errors"{% endif %}>
{% endif %}
{% if field.is_readonly %}
<p{% if field.widget.input_type == 'hidden' %} style="display:none;"{% endif %}>{{ field.contents }}</p>
{% else %}
{{ field.errors.as_ul }}
{{ field }}
{% endif %}
</td>
{% endfor %}
{% endfor %}
{% endfor %}
</div>
{% endfor %}
</div>
{% endblock %}
from ckeditor.widgets import CKEditorWidget
) но в итоге все это вложенные инлайны, только боль, под сложную логику уже проще становиться свою админку писать
CKEDITOR_CONFIGS = {
'default': {
'height': 300,
'width': 650,
'toolbar': 'Custom',
'toolbar_Custom': [
['FontSize', 'Font', 'Bold', 'Italic', 'Underline', 'Strike'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight'],
['NumberedList', 'BulletedList'],
['TextColor', 'Table'],
['Link', 'Unlink'],
['Image', 'Source'],
],
'extraPlugins': ','.join(['font', 'colorbutton']),
'font_names': 'Arial;Comic Sans MS;Courier New;Georgia;Times New Roman;Verdana',
'fontSize_sizes': '8/8px;10/10px;12/12px;14/14px;16/16px;18/18px;24/24px;36/36px',
'colorButton_colors': 'e50914,3f3f3f,00bcd4,2196f3,4caf50,ffeb3b,ff9800,ff5722',
'startupFocus': 'Ваш собственный текст здесь.',
'ImageAltRequired': False,
},
}