Thanks Nick,
I tried the first solution first.
You're right, the many to manys aren't editable on that page, but the
problem is, I'm not seeing another admin page for the new join model:
class FilmmakerPosition(models.Model):
filmmaker = models.ForeignKey(Filmmaker)
film = models.ForeignKey(Film)
position = models.IntegerField()
----------------------------------------------------
(it is in the db)
so there's no way I can assign filmmakers to a film in the admin.
In the Film class it specifies:
--------------------
filmmakers = models.ManyToManyField(Filmmaker,
through='FilmmakerPosition')
--------------------
Am I missing something?
I was slightly more intimidated by the inline example, as I'm not sure
I want to scrap the many to many relationship. (there are lots of
films that have multiple filmmakers and vice versa, and I'd like to be
able to list them on both ends) I'm still trying to wrap my head
around how I could do that with this example.
If anyone has anything else to add that would help me understand it
better, I'd really appreciate it.
Thanks,
Wendy
On Aug 13, 10:03 am, Nick Serra <
nickse...@gmail.com> wrote:
> You can go two directions with this. First, you could use a
> intermediate model for the many to many join, which would allow you to
> specify extra field on the join, in this case the order. Read up on
> this here:
http://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-o...
>
> The problem with solution one is that the many to many won't be
> editable on that page anymore.
>
> Solution two would be to scrap the manytomany and use inline models
> instead. You would make an intermediate model, say FilmmakerItem,
> which would foreign key to the model you want to join to, and a
> foreign key to the filmmaker, and would have a field for order. This
> would be editable in the admin under the same page.
>
> Read about inline here:
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#inlinemodelad...