#17577: Form instantiation hook for admin -------------------------+------------------------------------------------- Reporter: simon29 | Owner: simon29 Type: New | Status: new feature | Version: 1.3 Component: | Keywords: admin forms modelforms request init contrib.admin | add_view change_view validation Severity: Normal | Has patch: 0 Triage Stage: | UI/UX: 0 Unreviewed | Easy pickings: 0 | -------------------------+------------------------------------------------- Currently there is no hook to alter how forms are instantiated in admin, without hacking add_view/change_view.
This simple change could allow some nice stuff like access to the request object for form validation, customising fields, etc. http://stackoverflow.com/a/2684552/489638 http://stackoverflow.com/a/1388881/489638 Proposed syntax -- {{{ class MyAdmin(admin.ModelAdmin): ... def get_form_instance(self, request, obj=None): ... (default method calls get_form() here) }}} -- Ticket URL: <https://code.djangoproject.com/ticket/17577> Django <https://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 django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.