Open tobiasgardner opened 4 years ago
AdminB InlineModelAdmin is designed for to integrate with AdminA models like editing colums of the given AdminA.
class InlineModelAdmin(BaseModelAdmin):
"""
Options for inline editing of ``model`` instances.
Provide ``fk_name`` to specify the attribute name of the ``ForeignKey``
from ``model`` to its parent. This is required if ``model`` has more than
one ``ForeignKey`` to its parent.
"""
Other works because, template is already defined admin.
class TabularInline(InlineModelAdmin):
template = 'admin/edit_inline/tabular.html'
I hope this will help you.
Thanks for the answer dduraipandian! Not sure if it helps though. To me it seems like a generic answer on how Inlines works in Django, is that correct? My problem was that I could not get summernote to work with inline models.
Please StackedInline. Hope this works for you.
class ProductDescriptionInline(SummernoteModelAdminMixin, admin.StackedInline):
model = ProductDescription
fields = ('language', 'machine_translation', 'name', 'excerpt', 'content', )
summernote_fields = ('content', )
class ProductAdmin(SummernoteModelAdmin):
list_display = ('sku', 'name', 'needs_attention_comments', )
fields = ('sku', 'name', 'needs_attention_comments', )
summernote_fields = ('needs_attention_comments', )
inlines = (ProductDescriptionInline, )
Using summernote works fine for none-inline models but as soon as I try to use it with inline-models, I get an error. There is some sourcecode and stacktrace available in the link below. I have tried with the normal admin as well as with grappelli, same result. I am using python 3.7.1, django 2.2.11 and django-summernote 0.8.11.6