Good morning!
I have a modeo which has a field of type text in which is a "choice".
ANUNCIADA = 'A'
AMARRADA = 'M'
TERMINADA = 'T'
ANULADA = 'N'
LIST_ESTADOS_ANUNCIOS = (
(ANUNCIADA, 'Anunciada'),
(AMARRADA, 'Amarrada'),
(TERMINADA, 'Termina')
(ANULADA, 'Anulada'),
)
class Anuncio(models.Model):
estado_anuncio = models.CharField(max_length=1, blank=True, null=True, verbose_name='Estado', choices=LIST_ESTADOS_ANUNCIOS, default='A')
The problem I have now is to call it to the data. But I do not want with the initials, but they say 'A' = Announced, 'M' = Moored, 'T' = Finished, 'A' = Canceled. (Silly problem mine, since in the first instance you did not want to call)
If someone has an idea of how to call it that, it would be studying.
PDT: 1- In my API I call it, but as it is, it means 'A', 'M', 'T' ... and this is not required.
Thank you.