[Django] #29376: admin adjustability improvement: Take into account `show_save_and_add_another` context var

18 views
Skip to first unread message

Django

unread,
May 2, 2018, 3:37:11 AM5/2/18
to django-...@googlegroups.com
#29376: admin adjustability improvement: Take into account
`show_save_and_add_another` context var
-----------------------------------------+------------------------
Reporter: mihasK | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
To provide better adjustability, to introduce new context var -
`show_save_and_add_another`.
E.g. if I want to hide button "Save and add another", I can just modify
`extra_context` - write `False` to the variable.

For other buttons - "Save" and "Save and continue editing", this already
works exactly in this manner.

--
Ticket URL: <https://code.djangoproject.com/ticket/29376>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 2, 2018, 4:42:19 AM5/2/18
to django-...@googlegroups.com
#29376: admin adjustability improvement: Take into account
`show_save_and_add_another` context var
-------------------------------+--------------------------------------
Reporter: Mihas | Owner: nobody

Type: Uncategorized | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Carlton Gibson):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/9913 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:1>

Django

unread,
May 2, 2018, 5:01:28 AM5/2/18
to django-...@googlegroups.com
#29376: admin adjustability improvement: Take into account
`show_save_and_add_another` context var
-------------------------------+--------------------------------------
Reporter: Mihas | Owner: nobody

Type: Uncategorized | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Claude Paroz):

* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:2>

Django

unread,
May 2, 2018, 5:10:13 AM5/2/18
to django-...@googlegroups.com
#29376: admin adjustability improvement: Take into account
`show_save_and_add_another` context var
-------------------------------+--------------------------------------
Reporter: Mihas | Owner: nobody

Type: Uncategorized | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Carlton Gibson):

The options for Save and Save and continue were originally added to ensure
correct behaviour when hitting Save New and getting a validation error.
See
[https://github.com/django/django/commit/0894643e40327e48397573b7844585618200442b
0894643e4]. They weren't really for direct usage...

... however, maybe it's reasonable. Tentatively Accept to see how the
patch turns out, and what others think.

This isn't really documented (like much around extending the admin). Not
sure where it would go if we were to add something.

--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:3>

Django

unread,
May 2, 2018, 5:12:06 AM5/2/18
to django-...@googlegroups.com
#29376: admin adjustability improvement: Take into account
`show_save_and_add_another` context var
-------------------------------+------------------------------------
Reporter: Mihas | Owner: nobody

Type: Uncategorized | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:4>

Django

unread,
Aug 3, 2018, 11:58:03 AM8/3/18
to django-...@googlegroups.com
#29376: admin adjustability improvement: Take into account
`show_save_and_add_another` context var
--------------------------------------+------------------------------------
Reporter: Mihas | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham):

* type: Uncategorized => Cleanup/optimization


--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:5>

Django

unread,
Aug 23, 2018, 10:47:08 AM8/23/18
to django-...@googlegroups.com
#29376: Allow hiding the "Save and Add Another" button with a
`show_save_and_add_another` context variable

--------------------------------------+------------------------------------
Reporter: Mihas | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham):

A [https://stackoverflow.com/questions/13101281/in-django-admin-how-can-i
-hide-save-and-continue-and-save-and-add-another-butto/13104313
Stackoverflow question] suggests several alternatives including overriding
the template tag or adding some CSS.

I guess I'm okay with the patch (even if undocumented) but it needs a
test.

--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:6>

Django

unread,
Sep 12, 2018, 4:15:33 PM9/12/18
to django-...@googlegroups.com
#29376: Allow hiding the "Save and Add Another" button with a
`show_save_and_add_another` context variable
--------------------------------------+------------------------------------
Reporter: Mihas | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by gustavoefeiche):

Replying to [comment:6 Tim Graham]:


> A [https://stackoverflow.com/questions/13101281/in-django-admin-how-
can-i-hide-save-and-continue-and-save-and-add-another-butto/13104313
Stackoverflow question] suggests several alternatives including overriding
the template tag or adding some CSS.
>
> I guess I'm okay with the patch (even if undocumented) but it needs a
test.

The test is the only thing missing? I would like to work on it

--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:7>

Django

unread,
Apr 22, 2019, 9:46:08 AM4/22/19
to django-...@googlegroups.com
#29376: Allow hiding the "Save and Add Another" button with a
`show_save_and_add_another` context variable
--------------------------------------+------------------------------------
Reporter: Mihas | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Mushtaq Ali):

Hey Tim, Is this still available to work, if yes - I would like to add
unit tests to it ?

--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:8>

Django

unread,
Aug 29, 2019, 10:47:38 AM8/29/19
to django-...@googlegroups.com
#29376: Allow hiding the "Save and Add Another" button with a
`show_save_and_add_another` context variable
-------------------------------------+-------------------------------------
Reporter: Mihas | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* owner: nobody => Hasan Ramezani
* needs_better_patch: 1 => 0
* status: new => assigned
* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:9>

Django

unread,
Sep 16, 2019, 6:03:00 AM9/16/19
to django-...@googlegroups.com
#29376: Allow hiding the "Save and Add Another" button with a
`show_save_and_add_another` context variable
-------------------------------------+-------------------------------------
Reporter: Mihas | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b9db423d3c525697ad59b14c0dcaaccf2770d062" b9db423d]:
{{{
#!CommitTicketReference repository=""
revision="b9db423d3c525697ad59b14c0dcaaccf2770d062"
Fixed #29376 -- Allowed hiding "Save and Add Another" button in admin.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:10>

Reply all
Reply to author
Forward
0 new messages