ich erstellen Sie die folgenden Modelle registrieren:Django Admin ManyToMany Zwischenmodell
class Child(models.Model):
some_var = models.CharField()
class Parent(models.Model):
m2m = models.ManyToManyField(Child)
Django erstellt automatisch ein Zwischenmodell im Hintergrund genannt ParentChild
. Jetzt möchte ich dieses Zwischenmodell im Django Admin registrieren. Ist das möglich? Wenn das so ist, wie? Oder funktioniert es nur mit through="ThroughModel"
?
rechts, Django so angegeben https://docs.djangoproject.com/es/1.9/topics/db/models/#extra-fields-on-many-to-many-relationships und arbeitet in admin https://docs.djangoproject.com/de/dev/ref/contrib/admin/#working-with-many-to-many-intermediary-models –