﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35878	Allow to add M2M also in related-model form in admin site	David		"Given the following definition of models:

{{{#!python
from django.db import models

class ModelA(models.Model):
    name = models.CharField(max_length=10)

class ModelB(models.Model):
    name = models.CharField(max_length=10)
    others = models.ManyToManyField(ModelA)
}}}

The admin site allows to add the field `ModelB.others` to that model's admin, but there is no easy way to add the same relation on `ModelA` admin with the same functionality .

It is possible to add the field by providing a custom form in which the related-field is defined manually, however the form field widget will not be wrapped in `RelatedFieldWidgetWrapper` thus the ""add new entry"" button will not be present. This can be forced in the `ModelAdmin.form` by turning the `form` attribute into a property which builds the form class providing the right parameters to the reverse-field.

It would be a great enhancement to allow for an easier way to add reverse-m2m to a model-admin or to write down a guide to obtain such result."	Uncategorized	closed	contrib.admin		Normal	duplicate			Unreviewed	0	0	0	0	0	0
