models.py
class Test(models.Model):
name = models.CharField(max_length=256)
slug_name = models.CharField(max_length=256)
template = models.BooleanField("Is Template",default=False)
@staticmethod
def template_as_tuple():
return Test.objects.filter(template=True).values_list('id','name')
forms.py
class Test2(forms.ModelForm):
templates = forms.ChoiceField(choices=Catalogue.predefined_settings_as_tuple(), required=False)
path = orms.FileField()
The problem is when i add templates in the models it is not shown in the forms.py. I need to restart the webserver for the updates to be shown