1👍
✅
From your code sounds like you want to limit the choices of region your project can have. I think you should create an admin for RegionChoices
first. In there you could create entrances of RegionChoices
you like. Follow the django docs if you are not sure how to create an admin interface for a model https://docs.djangoproject.com/en/1.8/ref/contrib/admin/
ps: You might want to do unique=True
on region
field in RegionChoices
. Otherwise you might create duplicate entries of the same region by accident.
0👍
Okay, I realize I had to load data in the model RegionChoices.
I loaded the data in the admin part of my website and now, it works perfectly.
Source:stackexchange.com