Re: ModelForm question

2009-05-19 Thread George Song
On 5/18/2009 12:55 PM, Rusty Greer wrote: > > i have the following: > > a model: > class MyClass(models.Model): > otherClass = models.ForeignKey('otherClass') > someData = models.CharField(max_length=20) > > > class MyClassForm(forms.ModelForm): > > class Meta: > model = M

ModelForm question

2009-05-18 Thread Rusty Greer
i have the following: a model: class MyClass(models.Model): otherClass = models.ForeignKey('otherClass') someData = models.CharField(max_length=20) class MyClassForm(forms.ModelForm): class Meta: model = MyClass fields = ('someData') When the user edits or adds a M

Re: ModelForm question

2008-11-27 Thread sergioh
On Nov 26, 4:25 pm, fiedzia <[EMAIL PROTECTED]> wrote: > Hi > > I am trying to achieve the following effect: > > A ModelForm containing list of choices and input to possibly add > another > element to the list is presented on page. > If user will not choose any item from list and will type somet

ModelForm question

2008-11-26 Thread fiedzia
Hi I am trying to achieve the following effect: A ModelForm containing list of choices and input to possibly add another element to the list is presented on page. If user will not choose any item from list and will type something into new_item field, then: - if new_item is present on the list,

ModelForm Question

2008-06-19 Thread Adi
Lets say I have a model: class Foo(models.Model): name = models.charField() age = models.IntegerField () Then I create a form like this: class FooForm (ModelForm): salutation = forms.ChoiceField(choices=common.SALUTATION_CHOICES, label="Salutation") class