Help with styling: form for a many-to-many inline admin

20 views
Skip to first unread message

Derek

unread,
Jun 27, 2017, 7:33:38 AM6/27/17
to django-users
I am trying to improve the appearance of the inline editing appearance for a many-to-many field in the Django (1.10) admin .

The parent model contains the link:

class Sample(models.Model):
    id = models.AutoField(primary_key=True)
    # ...
    objectives = models.ManyToManyField(
        SampleObjective,
        related_name='sample_objectives',
        verbose_name=_('required objectives'))

In the admin:

class SampleObjectiveInline(admin.TabularInline):
    model = models.Sample.objectives.through
    exclude = ('objectives', )


class SampleAdmin(admin.ModelAdmin):
    # ...
    inlines = (SampleObjectiveInline, )




The image (above) shows that the default text for the section name, as well as the labels, is not very user-friendly. How do I alter/overwrite these?

Thanks
Derek

Reply all
Reply to author
Forward
0 new messages