Opened 18 years ago
Closed 18 years ago
#6561 closed (invalid)
Duplicated row entries with edit_inline=models.Tabular
| Reported by: | toomim | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.admin | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Fixed on a branch | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I'm editing a model A with two choice fields inline in a model B, using a 2x5 table.
class PubAuthor(models.Model):
author = models.ForeignKey(Person, core=True)
author_number = models.IntegerField(core=True, choices=[(1, 1), (2, 2), (3,3), (4,4), (5,5)])
pub = models.ForeignKey('Pub', edit_inline=models.TABULAR, num_in_admin=5, num_extra_on_change=5)
This works, except that if I edit a Pub and set only the FIRST row's author and author_number, and there is only 1 author in the database, then if I reload the page, the admin interface fills every row of the "author" column with that author! The "Author number" column remains empty.
This then gives me a validation error if I try to save it.
This seems to only happen if there's a single author in the database.
Attachments (1)
Change History (2)
by , 18 years ago
| Attachment: | Picture 9.png added |
|---|
comment:1 by , 18 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
| Triage Stage: | Unreviewed → Fixed on a branch |
Fixed on newforms-admin branch. Since that is nearing completion, no more patches will be applied against odlforms-admin.
Screenshot showing every row erroneously filled after reloading a Pub