I am developing an application for the generation of reports of fiber-optic certifications, and such reports are elaborated by importing XML and TXT files. The question is this:
A certification is made within an "Excerpt", which has the following attributes: ( Localidade_A
, Localidade_B
, distance, Dio_A
, Dio_B
, Fibras_A
, Fibras_B
, among others) .
My problem is precisely these Fibras_A
and Fibras_B
, because a snippet has ' Fibras_A
and' Fibras_B
, where 'x' and 'y' are passed at the time of creation of the Excerpt . I'm not getting, or rather, I'm not understanding how to create these ArrayLists
to Fibras_A
and Fibras_B
, in class Trecho
, depending on the value passed at creation time.
I have the class Trecho
, which has the following attributes:
class Trecho(models.Model):
rede = models.CharField("Rede*", max_length = 50, blank = False, choices = rede_choices)
localidade_A = models.ForeignKey(Localidade, related_name = 'localA', on_delete = models.CASCADE)
localidade_B = models.ForeignKey(Localidade, related_name = 'localB', on_delete = models.CASCADE)
dio_A = models.CharField("Dio", max_length = 10, blank = True, null = True)
dio_B = models.CharField("Dio", max_length = 10, blank = True, null = True)
distancia = models.CharField("Distância de A para B (m)*", max_length = 9, blank = False, null = True)
And a Fibra
class, which should have the following attributes:
class Fibra(models.Model):
id_fibra =
distancia =
subtrecho =
statusFibra =
A print of the screen for you to understand. When I click on salvar
the system should create 24 fibras_A
and 36 fibras_B
.