Answer the question
In order to leave comments, you need to log in
Create checkbox(choice) from list of django objects?
There are 2 models. The second model has a function that gets all the countries from the first model. I want to make a checkbox from a list of these countries. How to do it?
class GlobalEntry(models.Model):
country = models.CharField(max_length = 50)
post_id = models.CharField(max_length=200)
data = JSONField()
def __str__(self):
return self.country
class NormalEntry(models.Model):
def getter(self):
return GlobalEntry.objects.values('country')
country = CHECKBOX???
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