How can I limit the options of a ModelForms field to fks in the same model object?

I want to limit the options of ‘winner’, which is a foreign key to the Jugador model, to the foreign keys of the ‘playerA’ and ‘playerB’ fields, which also point to the Jugador model. I guess I need to somehow access the instance of the Game model the form was created with in order to do a proper query set.

the form in

class ganadorForm(ModelForm):

    class Meta:
        model = Juego
        fields = ['ganador', 'jugadorA', 'jugadorB', 'torneo', 'ronda']
        widgets = {
            'ganador': ModelChoiceField(queryset=Jugador.objects.filter(Q(fields['jugadorA']) | Q(fields['jugadorB'])), to_field_name='nombre')

the model in

class Juego(models.Model):
    torneo = models.ForeignKey(Torneo, on_delete=models.CASCADE, null=False)
    ronda = models.ForeignKey(Ronda, on_delete=models.CASCADE, null=False)
    jugadorA = models.ForeignKey(Jugador, on_delete=models.SET_NULL, null=True, related_name='jugadorA')
    jugadorB = models.ForeignKey(Jugador, on_delete=models.SET_NULL, null=True, related_name='jugadorB')
    ganador = models.ForeignKey(Jugador, on_delete=models.SET_NULL, null=True, default=None, related_name='ganador')

I have tried other approaches to

class ganadorForm(ModelForm):

    class Meta:
        model = Juego
        fields = ['ganador', 'jugadorA', 'jugadorB', 'torneo', 'ronda']

    def __init__(self, *args, **kwargs):
        super(ganadorForm, self).__init__(*args, **kwargs)
        self.fields['ganador'].queryset = Jugador.objects.filter(Q( | Q(

You can’t do this in the queryset, because all three fields could be changed in the form - unless you implement this using some JavaScript to dynamically set the available options. (If jugadorA and jugadorB were read-only fields, then it would make sense to do it that way.)

To perform the validation on the back end, see Form and field validation | Django documentation | Django.