Re: Forms, ChoiceFields and import?

2012-09-12 Thread Stephen Anto
Hi, in forms.py import all from models.py forms.py: from tafe.models import * It may solve your problem. Thanks for visiting! and For Django Interview questions and answers On Wed, Sep 12, 2012 at 6:56 AM, Lachlan Musicman wrote:

Re: Forms, ChoiceFields and import?

2012-09-11 Thread Lachlan Musicman
On Wed, Sep 12, 2012 at 1:35 PM, m1chael wrote: > Timtables should also be Timetables Yep - thanks. All good now, you were spot on with the missing parentheses Cheers L. > > > On Tue, Sep 11, 2012 at 9:30 PM, m1chael wrote: >> >> it looks like you have a syntax error here: >> >> timetable

Re: Forms, ChoiceFields and import?

2012-09-11 Thread m1chael
Timtables should also be Timetables On Tue, Sep 11, 2012 at 9:30 PM, m1chael wrote: > it looks like you have a syntax error here: > > timetable = > forms.ModelChoiceField(queryset=Timtables.objects.all.ordered_by('-date') > > should be: > > timetable > = forms.ModelChoiceField(queryset

Re: Forms, ChoiceFields and import?

2012-09-11 Thread m1chael
it looks like you have a syntax error here: timetable = forms.ModelChoiceField(queryset=Timtables.objects.all.ordered_by('-date') should be: timetable = forms.ModelChoiceField(queryset=Timtables.objects.all.ordered_by('-date')) # added a ) On Tue, Sep 11, 2012 at 9:26 PM, Lachlan M

Forms, ChoiceFields and import?

2012-09-11 Thread Lachlan Musicman
Hi Is there anyway to import the choices from my models.py into my forms.py to prevent code duplication? At the moment I've got the following, but I'm getting invalid sytax errors in my forms.py: models.py : SESSION_CHOICES = ( (u'0',u'Morning 1'), (u'1',u'Morning 2')