On Fri, Sep 07, 2007 at 03:24:46PM -0500, jake elliott wrote:
> 
> Oleg Korsak wrote:
> >> Sure - use the 'fields' option to specify the subset of model fields
> >> you want to use on the form.
> >>
> >   form_for_instance() got an unexpected keyword argument 'fields'
> > 
> 
> this argument to form_for_instance() and form_for_model() is only
> available in the SVN version of django.
> 
> one quick way to get this behavior without that argument is to set the
> 'user' field 'editable=False'
> 
> user = models.ForeignKey(User, editable=False)
> 
> remember this will affect the change form in contrib.admin also, which
> may or may not be desirable for your project.
> 
> -jake

i have a related question, is there a way to change the
order of the fields, too?

my form adds a second password field like this:


class JoinForm(forms.BaseForm):
    def __init__(self, *args, **kwargs):
        self.base_fields['pw2'] = forms.CharField( label = 'again', min_length 
= 3 )
        self.base_fields['pw2'].widget = forms.PasswordInput()


unfortunately this new field always appears at the end
of my form and fields=(..) doesn't affect the order.


-mark


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to