Code

Opened 5 years ago

Last modified 8 weeks ago

#11574 new New feature

Allow extra blank rows for adding new records when using list_editable in admin change list view

Reported by: rfugger Owned by:
Component: contrib.admin Version: master
Severity: Normal Keywords: list_editable extra rows add
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

Now that we can edit records in bulk in the admin using list_editable, it would be nice to be able to add new items in bulk in the same way. Something like a list_editable_extra field on ModelAdmin that works similarly to the extra field on InlineModelAdmin.

What's seems to be needed:

  • Set the extra parameter to modelformset_factory in ModelAdmin.get_changelist_formset to generate the empty forms.
  • Adapt the result_list template tag in admin_list.py to show the extra forms. This can be done by calling items_for_result with an empty model for each empty form.
  • Adapt paginator and actions area to account for the extra rows. Not quite sure how to do this.

Attachments (0)

Change History (9)

comment:1 Changed 5 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 3 years ago by julien

  • Severity set to Normal
  • Type set to New feature

comment:3 Changed 3 years ago by julien

  • UI/UX set

comment:4 Changed 2 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:5 Changed 2 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:6 Changed 2 years ago by aaugustin

  • UI/UX set

Revert accidental batch modification.

comment:7 Changed 13 months ago by aaugustin

  • Triage Stage changed from Design decision needed to Accepted

This sounds like a worthy improvement, and it's consistent with how inlines work.

comment:8 Changed 8 weeks ago by gregchapple

  • Owner changed from nobody to gregchapple
  • Status changed from new to assigned

comment:9 Changed 8 weeks ago by gregchapple

  • Owner gregchapple deleted
  • Status changed from assigned to new

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new
The owner will be changed from (none) to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.