Code

Opened 5 years ago

Closed 5 years ago

#10330 closed (duplicate)

ManyToManyField shows up last in admin form & model form

Reported by: koto Owned by: nobody
Component: Uncategorized Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I have a model that contains a ManyToManyField. Independent of where in the model definition I put this ManyToManyField, it's always shown last in the admin edit / new page, as well as in my custom forms.
If I change the field definition from ManyToManyField to ForeignKey, the position of this field is where I expect it to be (in this example, after the project field).

class Experiment(models.Model):
    author          = models.ForeignKey(User)
    title           = models.CharField(max_length=255)
    slug            = models.SlugField()
    project         = models.ForeignKey(Project)
    protocol        = models.ManyToManyField(Protocol, blank=True, null=True)
    plan            = models.TextField(blank=True, null=True)
    end_date        = models.DateField(blank=True, null=True)

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

This is a duplicate of #6953.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.