Good morning! I have the following question:
I have a Person class, of which I can have 3 types of person (Victim, Aggressor and Witness) in the same form ... how would I do to set the variables so that when saving to the bank are 3 different attributes
ex.
Crimes Against Life Form
VICTIM
fom_vida.name
AGRESSOR
form_vida.name
WITNESS
form-vida.name
This in the same form, that is, I want to differentiate the variables!
Hello, Renan. I do not understand your answer:
class ForensicAgressor(models.Model):
name = models.CharField(max_length=100, blank=True, null=True, verbose_name='Nome')
birth = models.DateTimeField(blank=True, null=True, verbose_name='Data de Nascimento')
class ForensicVitima(models.Model):
name = models.CharField(max_length=100, blank=True, null=True, verbose_name='Nome')
birth = models.DateTimeField(blank=True, null=True, verbose_name='Data de Nascimento')
class ForensicPessoa(models.Model):
agressor = models.ForeignKey(ForensicAgressorn)
vitima = models.ForeignKey(ForensicVitima)
See above how it is, what would I do in the same Form to set the input of each object?