Sunday, January 29, 2012

Re: ModelForm

You can exclude certain fields from the form using exclude['fieldname'] in that FormName class

On 28/01/2012 6:08 AM, "hack" <scottmacri@gmail.com> wrote:

Hello,
I am new to Python and have a Java background.

I have created a bunch of models, and forms using ModelForm:
class FormName(ModelForm):
       class Meta:
               model = FormName

Whenever I display the form in my browser with {{ form.as_table }} the
form queries all the foreign key data and displays it in a pulldown.

Is there a way to disable this functionality and still be able to use
Models for my forms?  Thanks.

I expect there is a param or something similar to blank=False or
something.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment