Opened 17 years ago
Closed 17 years ago
#5520 closed (fixed)
[newforms-admin] - support for save_as
Reported by: | Owned by: | Brian Rosner | |
---|---|---|---|
Component: | contrib.admin | Version: | newforms-admin |
Severity: | Keywords: | admin, save_as, nfa-blocker | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
With the attached patch it is possible to use save_as in newforms-admin.
Related objects are not saved - this patch cares only about template.
Attachments (4)
Change History (10)
by , 17 years ago
Attachment: | admin-save-as.diff added |
---|
by , 17 years ago
Attachment: | 01-admin-saveas.diff added |
---|
comment:1 by , 17 years ago
comment:2 by , 17 years ago
I use this patch but I have two notes:
- Button save_as_new can be showed in change stage so add_permission should be checked.
- Context variable show_delete is not used anywhere so it can be removed.
Also my comment comment:ticket:5520:1 could be relevant.
by , 17 years ago
Attachment: | 00-admin-saveas.diff added |
---|
This version fixes permission for save as and remove context parameter show_delete which is not necessary for this functionality
comment:4 by , 17 years ago
Keywords: | nfa-blocker added |
---|---|
Needs tests: | set |
Triage Stage: | Unreviewed → Accepted |
The code just delegates to ModelAdmin.add_view()
if someone clicks the "save as new" button, so fixing the templates should allow for saving copies of all the inline objects as well. However, I haven't tried this. There really ought to be some tests to make sure.
comment:5 by , 17 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Taking this ticket as I need to implement this for work.
comment:6 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
New version of patch - now save_as works without any problem. It is better than in oldforms admin.
The final version of submit row (with #5447):
As popup (is_popup is True) only save button is showed.
In saving as (is_save_as is True) only save_as_new button is showed.
Otherwise:
I also removed form_url - it is not needed in this solution.