django forms exclude values from choicefield

2020-01-05 Thread Muhammad Mahir
I want to exclude those options from the ChoiceField in the forms that has been already selected and are into the database. Below is the Code. models.py SEMESTER_CHOICES = ( ("1", "1"), ("2", "2"), ("3", "3"), ("4", "4"), ("5", "5"), ("6", "6"), ("7", "7"), ("8"

django forms exclude values from choicefield that are already into database

2020-01-05 Thread Muhammad Mahir
I want to exclude those options from the ChoiceField in the forms that has been already selected and are into the database. Below is the Code. models.py ``` SEMESTER_CHOICES = ( ("1", "1"), ("2", "2"), ("3", "3"), ("4", "4"), ("5", "5"), ("6", "6"), ("7", "7"), ("8