Django form linked to record

1

I have two tables in Django (Game and Gol) and I'm trying to create a form for them:

class Jogo(models.Model):
    ativo = models.BooleanField(default = True)
    dataHoraInicio = models.DateTimeField(verbose_name = 'Data e Hora de Início')
    dataHoraFim = models.DateTimeField(verbose_name = 'Data e Hora de Fim', null = True, blank = True)

class Gol(models.Model):
    jogo = models.ForeignKey(Jogo, on_delete = models.CASCADE)
    minuto = models.IntegerField(help_text = 'Minuto do jogo em que aconteceu o gol')
    jogador = models.CharField(max_length = 50)

My question is to link form fields to Gol table records so that for each record there are the 'minute' and 'player' fields where the user can modify the table data.

How can I do this?

    
asked by anonymous 04.01.2019 / 20:27

0 answers