tenha o seguinte model: class TurmaAluno(models.Model): aluno = models.ForeignKey(Aluno, on_delete=models.CASCADE) turma = models.ForeignKey(Turma, on_delete=models.CASCADE) Os dados para preencher esse model vem do meu html: <p>Aluno:</p> {% for alunos in alunos %} <label for="Aluno">{{ alunos.nome }}</label> <input type="checkbox" name="alunos" value="{{ alunos.nome }}"><br> {% endfor %} <br><br><br> <label for="Turma">Turma: </label> <select name="turma"> <option selected>Turmas</option> {% for turmas in turmas %} <option>{{ turmas.ano }}</option> {% endfor %} </select> E essa é a view: def efetuarMatricula(request): context = {'alunos': Aluno.objects.all(), 'turmas': Turma.objects.all()} if request.method != "POST": return render(request, 'turma/index.html', context) else: turma = request.POST.get('turma') alunos = request.POST.getlist('alunos') bb = Turma.objects.filter(ano=turma) for alunos in alunos: cc = Aluno.objects.filter(nome=alunos) new = TurmaAluno(aluno=cc, turma=bb) new.save() Mas quando eu tento salvar da o seguinte erro: Cannot assign "<QuerySet [<Aluno: Aluno object (1)>]>": "TurmaAluno.aluno" must be a "Aluno" instance. Continue reading...