#6002: Better saving in newforms-admin ModelAdmin --------------------------------------------------+------------------------- Reporter: Petr Marhoun <[EMAIL PROTECTED]> | Owner: nobody Status: new | Component: Admin interface Version: newforms-admin | Keywords: Stage: Unreviewed | Has_patch: 1 --------------------------------------------------+------------------------- There are two very long methods in django.contrib.admin.options.!ModelAdmin - save_add and save_change. They do three different things - they save objects, they log what happened and they redirect. So I propose to divide them.
Method add_view would call save_add for saving, log_add for logging and redirect_after_save for redirection. Method change_view would call save_change for saving, log_change for logging and redirect_after_save for redirection. Methods save_add and save_change would be useful for complex saving which depends on forms and inline formsets together. (It solves #4507.) Methods log_add and log_change could be used for example for something as !AuditModelAdmin or !NoLogAdmin. Method redirect_after_save would be something as render_change_form - technical code common for adding and changing, which is not interesting very much. I feel that now redirection is quite broken, it does not check permissions correctly. My patch fixes it too. -- Ticket URL: <http://code.djangoproject.com/ticket/6002> Django Code <http://code.djangoproject.com/> The web framework for perfectionists with deadlines --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---
