To add a simple type of copy functionality to the Django admin I would like to render the default admin add form of a model but with default values. I know that the add form accepts GET parameters to pre-populate most fields, but I don't always want to copy M2M references, sometimes the referenced objects also need to be copied.
What I would like to do in code:
def some_view(self, request, pk):
modeol_original = FooModel.objects.get(pk)
model_copy = FooModel()
copy_attributes_custom(model_original, model_copy)
return render_default_django_add_page_for_model(model_copy)
As dhana mentioned in the comments, this is possible as seen in: Django set default form values but only for custom templates. I wan't to use the default Django Admin add form/template.