question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTMLField does not load correctly when model displayed as inline in Django Admin

See original GitHub issue

I’m having problems trying to get the HTMLField editor to work when the field is displayed on an inline. The two below screenshots demonstrates viewing the admin of the model directly, where it works, and then as an inline where it doesn’t:

standard inline

models.py:

from django.db import models
from djangocms_text_ckeditor.fields import HTMLField

class Header(models.Model):
    name = models.CharField(max_length=50)

    def __unicode__(self):
        return '%s' % self.name


class TestField(models.Model):
    header = models.ForeignKey('Header')
    text = HTMLField()

    def __unicode__(self):
        return self.text[:50]

admin.py:

from django.contrib import admin
from .models import TestField, Header

@admin.register(TestField)
class TestFieldAdmin(admin.ModelAdmin):
    pass

class TestFieldInline(admin.StackedInline):
    model = TestField
    extra = 0


@admin.register(Header)
class HeaderAdmin(admin.ModelAdmin):
    inlines = (TestFieldInline,)

I’m using:

Django==1.9.10
django-cms==3.3.1
djangocms-text-ckeditor==3.1.0

Any ideas?!

Thanks

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
czpythoncommented, Sep 30, 2016

Hey @tdsymonds, we can reproduce the issue locally. We’ll update you once a fix is out. Thanks!

0reactions
vxsxcommented, Oct 5, 2016

Should be fixed with 3.3.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTMLField does not load correctly when model displayed as ...
I'm having problems trying to get the HTMLField editor to work when the field is displayed on an inline. The two below screenshots ......
Read more >
Django InlineModelAdmin not displaying inlineformset correctly
I think there is an error in your code where your FichaTecnicaInline class is overwritten by your admin class definition.
Read more >
TinyMCE not working: possible causes and fixes
When inline mode is on, but TinyMCE isn't working, check the element you've selected to be a rich text editor. TinyMCE inline mode...
Read more >
Django admin: How to insert Inline between fields
It does not quite work properly under the most recent version of django (2.1.7). I made some edits to fieldset.html to get it...
Read more >
Mezzanine Documentation - Read the Docs
When registering content type models with PageAdmin or subclasses of it, the admin class won't be listed in the.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found