Opened 8 years ago
Closed 8 years ago
#27643 closed Bug (invalid)
ModelAdmin.save_as is ignored
Reported by: | Flavio Curella | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 1.10 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have the following model:
from django.db import models # Create your models here. class MyModel(models.Model): name = models.CharField(max_length=50)
and a basic admin class for the model:
from django.contrib import admin from .models import MyModel # Register your models here. class MyModelAdmin(admin.ModelAdmin): save_as = True admin.site.register(MyModel, MyModelAdmin)
According to the documentation (https://docs.djangoproject.com/en/1.10/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_as) I should see three buttons: 'Save', 'Save and continue editing' and 'Save as new', but I still get 'Save', 'Save and continue editing' and 'Save and add another'
Attachments (1)
Change History (2)
by , 8 years ago
Attachment: | Screen Shot 2016-12-26 at 12.17.15 PM.png added |
---|
comment:1 by , 8 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
after looking through the code, it's clear that the
save_as
option only applies when _editing_ an existing object.Although not explictly stated, it is somewhate implied in the docs (emphasis added):
Closing as invalid,