1
I am developing an application for reporting optical fiber certifications, and such reports are produced by importing XML and TXT files. The question is as follows:
A certification is made within a "Section", which have the following attributes: (Localidade_A
, Localidade_B
, distance, Dio_A
, Dio_B
, Fibras_A
, Fibras_B
, among others).
My problem is right there Fibras_A
and Fibras_B
, because an excerpt has 'x' Fibras_A
and 'y' Fibras_B
, where 'x' and 'y' are passed at the time of the creation of the Excerpt. I’m not getting, or better, I’m not understanding how to create these ArrayLists
for Fibras_A
and Fibras_B
, in class Trecho
, depending on the value passed at the time of creation.
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 class Fibra
, which must have the following attributes:
class Fibra(models.Model):
id_fibra =
distancia =
subtrecho =
statusFibra =
A screen print for you to understand. When I click on salvar
the system shall create 24 fibras_A
and 36 fibras_B
.
Thank you very much, I’ll try to do it here.
– Jamisson Seigler
It worked out, thank you very much my friend, it saved my day
– Jamisson Seigler