From f212b24b6469b66424354bf970f3051df180b88d Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Fri, 16 Jan 2009 15:32:31 +0000 Subject: 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 --- .../admin_widgets/fixtures/admin-widgets-users.xml | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/regressiontests/admin_widgets/fixtures/admin-widgets-users.xml (limited to 'tests/regressiontests/admin_widgets/fixtures/admin-widgets-users.xml') diff --git a/tests/regressiontests/admin_widgets/fixtures/admin-widgets-users.xml b/tests/regressiontests/admin_widgets/fixtures/admin-widgets-users.xml new file mode 100644 index 0000000000..b851562a1c --- /dev/null +++ b/tests/regressiontests/admin_widgets/fixtures/admin-widgets-users.xml @@ -0,0 +1,43 @@ + + + + super + Super + User + super@example.com + sha1$995a3$6011485ea3834267d719b4c801409b8b1ddd0158 + True + True + True + 2007-05-30 13:20:10 + 2007-05-30 13:20:10 + + + + + testser + Add + User + auser@example.com + sha1$995a3$6011485ea3834267d719b4c801409b8b1ddd0158 + True + True + False + 2007-05-30 13:20:10 + 2007-05-30 13:20:10 + + + + + + 100 + Volkswagon + Passat + + + 101 + BMW + M3 + + + \ No newline at end of file -- cgit v1.3