syncdb on fresh database fails

Issue #157 resolved
Randle Taylor created an issue

This bit of code:

class SetReferencesAndTolerancesForm(forms.Form):


    testlistchoices = models.TestList.objects.all().order_by("name").values_list("pk", 'name')
    testlistcyclechoices = models.TestListCycle.objects.all().order_by("name").values_list("pk", 'name')
    choices = [('', '---------')] 
    source_testlist = forms.ChoiceField(choices, label='Source testlist(cycle)')

fails on syncdb for a brand new database because the qa_testlist & qa_testlistcycle tables haven't been created yet.

The solution is to set the choices dynamically in init instead of in the class definition.

Comments (2)

  1. Randle Taylor reporter

    @wenzevanklink you may want to be aware of this too...I hadn't run into the problem until today when I tried to syncdb on a fresh db :)

  2. Log in to comment