I'm working with Django admin, and I'd like to be able to use an existing instance of a model as a template for making a new object, so people using django admin don't need to re-key all the same properties on a object, when making new objects.
I'm picturing it a bit like this at the bottom of the Django admin form for updating a single object:
The django docs explain how to add bulk actions, by adding to the actions on a model, like so:
class ArticleAdmin(admin.ModelAdmin):
actions = ['make_published']
def make_published(self, request, queryset):
queryset.update(status='p')
make_published.short_description = "Mark selected stories as published"
However, it wasn't so clear to me how to do this for a single change model form on an object, for actions I only want to apply to model at a time.
How would I do this?
I'm guessing I probably need to hack around with the change_model form, but beyond that, I'm not so sure.
Is there a fast way to do this without overriding loads of templates ?
