Accessing django choice field
- by Hulk
there is a module as header ,
from test.models import SEL_VALUES
class rubrics_header(models.Model):
sel_values = models.IntegerField(choices=SEL_VALUES)
So when SEL_VALUES is imported from test.modules.What is the code that has to go in views to get the choices in sel_values .
And the test.modules has the following,
class SEL_VALUES:
vaue = 0
value2 = 1
class Entries(forms.Form) :
models.IntegerField(choices=SEL_VALUES)
SEL_VALUES = ((ACCESS.value,'NAME'),(ACCESS.value2,'DESIGNATION'))