I'm finding django foreign keys a bit confusing, is there any way to do the view below, using a single query?
Programme and assign to
programme, but you never use the result anywhere. Just remove that line.
I think you are looking to something like that:
which are select_related, you put before final get. That is your line:
actors = Actor.objects.filter(programme = programme_id)
should look like
actors = Actor.objects.select_related().filter(programme = programme_id)
Unfortunately as emphasized here: get foreign key objects in a single query - Django you will only be able to retrieve actors that way as select_related only works on objects having ForeignKeys and not vice versa.