diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-01-16 15:32:31 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-01-16 15:32:31 +0000 |
| commit | f212b24b6469b66424354bf970f3051df180b88d (patch) | |
| tree | 379b8102f38ddde424cb0005cf2f468d409f691e /tests/regressiontests/admin_widgets/urls.py | |
| parent | d579e716fef9f06f04861815cf949630d8633271 (diff) | |
Cleaned up and refactored `ModelAdmin.formfield_for_dbfield`:
* The new method uses an admin configuration option (`formfield_overrides`); this makes custom admin widgets especially easy.
* Refactored what was left of `formfield_for_dbfield` into a handful of smaller methods so that it's easier to hook in and return custom fields where needed.
* These `formfield_for_*` methods now pass around `request` so that you can easily modify fields based on request (as in #3987).
Fixes #8306, #3987, #9148.
Thanks to James Bennet for the original patch; Alex Gaynor and Brian Rosner also contributed.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9760 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/admin_widgets/urls.py')
| -rw-r--r-- | tests/regressiontests/admin_widgets/urls.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_widgets/urls.py b/tests/regressiontests/admin_widgets/urls.py new file mode 100644 index 0000000000..af73d5351d --- /dev/null +++ b/tests/regressiontests/admin_widgets/urls.py @@ -0,0 +1,7 @@ + +from django.conf.urls.defaults import * +import widgetadmin + +urlpatterns = patterns('', + (r'^', include(widgetadmin.site.urls)), +) |
