Legend:

The straight-forward way to do this with a relational database is to create an intermediary table (as Django does automatically with ManyToManyField) and then add fields to that table. Setting up this structure in Django is also straight-forward, but it took some work for me to find the right Field arguments to make it all work as I'd like on the admin side. Here's how I did it:

1

The [source:trunk/tests/testapp/models/m2m_intermediary.py Many-to-Many Intermediary] test case already shows how this is structured. What I add here is a set of parameters for the fields in the intermediary model that allow smooth inline editing in admin.

1. {{{core=False}}} ''# So that when an {{{Individual}}} is being created along with a few {{{Participations}}} created inline, the {{{Participation}}} records will be valid even though the {{{Individual}}} doesn't fully exist yet.''

21

1. {{{blank=True, default=None}}} ''# So that untouched inline records will have blank core values and thus will not be created.''