Re: sanity check regarding ModelForm

2011-03-22 Thread Kenneth Gonsalves
On Tue, 2011-03-22 at 08:15 -0400, Karen Tracey wrote: > > that the same code is being written twice) > > > > Russ has already answered so I'm not going to repeat what he said. > I'll > note, though, that there's some good doc on this (overriding default > field > values in a model form) here: > h

Re: sanity check regarding ModelForm

2011-03-22 Thread Karen Tracey
On Tue, Mar 22, 2011 at 2:31 AM, Kenneth Gonsalves wrote: > on running this, I get a form with two fields, name and age. Which is > what is wanted. So is there anything wrong in coding it this way? I am > asking this because a co-worker submitted code like this and it is > working, so I do not kno

Re: sanity check regarding ModelForm

2011-03-22 Thread Kenneth Gonsalves
On Tue, 2011-03-22 at 14:41 +0800, Russell Keith-Magee wrote: > > working, so I do not know how to react (apart from the obvious > comment > > that the same code is being written twice) > > Aside from the redundancy, there's nothing inherently wrong with this. > > The fact that this is allowed at

Re: sanity check regarding ModelForm

2011-03-21 Thread Russell Keith-Magee
On Tue, Mar 22, 2011 at 2:31 PM, Kenneth Gonsalves wrote: > hi > > assume a model: > > Mymodel > name=CharField > age = IntegerField > > and a ModelForm: > > Mymodelform(forms.ModelForm): >        name = forms.CharField() >        age = forms.IntegerField() >        class Meta: >                mo

sanity check regarding ModelForm

2011-03-21 Thread Kenneth Gonsalves
hi assume a model: Mymodel name=CharField age = IntegerField and a ModelForm: Mymodelform(forms.ModelForm): name = forms.CharField() age = forms.IntegerField() class Meta: model = Mymodel on running this, I get a form with two fields, name and age. Which