Django Query Data

2014-05-04 Thread Brendan Edwards
Hi, I have just started learning Django (been flip flopping between meteor and django, cant decide which to use..) and I am fairly new to web development in general. Basically, I have a query where I am using the code "teecolor = GolfCourseTees.objects.values('Tee_Color').filter(Course_Name=

Django Database Data Type

2014-05-05 Thread Brendan Edwards
Hi, I have just started learning Django (been flip flopping between meteor and django, cant decide which to use..) and I am fairly new to web development in general. Basically, I have a query where I am using the code "teecolor = GolfCourseTees.objects.values('Tee_Color').filter(Course_Name=co

Re: Django Database Data Type

2014-05-05 Thread Brendan Edwards
Thanks a lot for the reply! It got me thinking and I changed the code around a bit and was able to get the result I was looking for. What I did in the end was: teecolor = GolfCourseTees.objects.filter(Course_Name='course').values() tee1 = teecolor[0] and in the HTML i used {{ tee1.hole1_distanc

Re: Multiple Model Form Generation

2014-05-15 Thread Brendan Edwards
Why not just do this? (Not sure if this is the most efficient way..) models.py: > class SignUpForm(forms.ModelForm): > class Meta: > model = Customer > class VmForm(forms.ModelForm): class Meta: model = Vms class VmSpecForm(forms.ModelForm):

Re: Multiple Model Form Generation

2014-05-15 Thread Brendan Edwards
> > Why not just do this? (Sorry for the crappy indentation.. tab doesn't work > on here for some reason) > > models.py: > > >> class SignUpForm(forms.ModelForm): >> class Meta: >> model = Customer >> > > class VmForm(forms.ModelForm): > class Meta: >

Make a model form field not required

2014-05-15 Thread Brendan Edwards
Hi, I am having some issues with making my form/model fields not required. Currently this is the code that I have: forms.py: class startRound(forms.ModelForm): player_2 = forms.CharField(widget=forms.TextInput(attrs={'disabled':'True', 'hidden':'True', 'id':'player_2'})) player_3 = forms.CharF

Re: Make a model form field not required

2014-05-16 Thread Brendan Edwards
Works like a charm, but I don't completely understand why that is necessary. When I defined the text input as hidden and disabled, it overwrote the initial settings of that field? what exactly does this line do? def __init__(self, *args, **kwargs): forms.ModelForm.__init__(self