Answer the question
In order to leave comments, you need to log in
How to work with choices correctly?
I need users to be able to add tags to the model:
class Task(models.Model):
PROGRAMMING_TYPES = (
('FD', 'Frontend'),
('BD', 'Backend'),
('HL', 'High load / Multithreading'),
('ML', 'Machine learning'),
('PS', 'Parsing / Data mining'),
('DB', 'Databases / SQL'),
('AL', 'Administration / Linux'),
)
...
tag = models.CharField(max_length=9, choices=PROGRAMMING_TYPES)
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question