Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 323281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:00:59+00:00 2026-05-12T09:00:59+00:00

i have a form, but i need to re-orden the form fields, plese some

  • 0

i have a form, but i need to re-orden the form fields, plese some body will tell me how? im try with fields = [‘x’,’y’] but nothing happen.

class DiligenciaForm(ModelForm):
    titulo = forms.CharField(max_length=70,help_text='Dele un nombre a su diligencia.')
    tipo = forms.ChoiceField(choices=TIPO)  
    vias= forms.TypedChoiceField(widget=forms.RadioSelect(), choices=CHOICES)    



class Meta:
    model = Diligencia
    exclude =('socio','secuencia','ffin','fecha','fentrada','status')
    fields = ['titulo', 'tipo','vias']

i need this orden “titulo”, “tipo” and “vias”… but is not working

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:01:00+00:00Added an answer on May 12, 2026 at 9:01 am

    I’ll assume you meant you need to reorder the forms? The only problem I see with your code is that you have both the exclude and the fields settings in the Meta class. Also (although it might not be this way in your code) the indentation is wrong. So, fixed, it would look something like this:

    class DiligenciaForm(ModelForm):
        titulo = forms.CharField(max_length=70, help_text='Dele un nombre a su diligencia.')
        tipo = forms.ChoiceField(choices=TIPO)  
        vias= forms.TypedChoiceField(widget=forms.RadioSelect(), choices=CHOICES)    
    
        class Meta:
            model = Diligencia
            fields = ['titulo', 'tipo', 'vias',]
    

    Now if you need to reorder the fields just change their order in the ‘fields’ variable to whatever you want. Also make sure you’re running Django version 1.1 as the documentation seems to indicate the ability to reorder the fields was introduced in that version (see here: http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form )

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a simple form (only extract fields here) but for some reason the JQserilization
I have 5 links that are on the same form but I would like
Ok, I have a validation script that checks everything on the form - but
I have found the Form.TopMost property but it puts the form on top of
I have a form that I don't render as part of HTML page but
I have a form with an initial value, but I can't get the initial
I have a form which encapsulates all the functionality, but works with a concrete
I have a form where I've specified onSubmit=validate() , but I want to ignore
I have this form for inputting the birthday in html. But I only have
I have a form that once submitted some of its result are stored in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.