I have a model having choices field. I want to fetch the choices options in a list.
How can I achieve that?
OPTIONS = (
('COOL', 'COOL'),
('WARM', 'WARM'),
)
class My_Model(models.Model):
options = models.CharField(max_length=20, choices=OPTIONS, default=None,blank=True, null=True)
I want options values in a list like ['COOL','WARM'], How to achieve it, I tried something like My_Model.options but it is not working.