Changes between Version 12 and Version 13 of AJAXForeignKey
- Timestamp:
- May 20, 2007, 9:22:23 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AJAXForeignKey
v12 v13 2 2 3 3 == The Problem == 4 In the Admin, I would like to have an autocompletion field for !ForeignKey references. I know {{{raw_id_admin}}} works , but AJAX is just so much cooler.4 In the Admin, I would like to have an autocompletion field for !ForeignKey references. I know {{{raw_id_admin}}} works for foreign keys to big tables, but AJAX is just so much cooler. 5 5 6 6 == The Solution == … … 18 18 * {{{__init__.py}}} -- duh 19 19 * {{{fields.py}}} -- contains the actual model field. (download) 20 * {{{forms.py}}} -- contains the form field. (download )21 * {{{views.py}}} -- contains the AJAX view. (download)20 * {{{forms.py}}} -- contains the form field. (download '''forms2.py''' and rename) 21 * {{{views.py}}} -- [#Onelastthing contains the AJAX view. (download) ] 22 22 23 23 3. [#Creatingbase_templatesadminbase_site.html Create a base_site.html file in your base_templates/admin directory.] … … 101 101 }}} 102 102 103 === One Last Thing === 104 105 If you downloaded {{{ fields.py }}}, you need to make sure the import line at the top correctly imports the Form field. 106 107 You might need to change this 108 {{{ 109 #!python 110 from ajaxfkey.forms import AjaxForeignKeyFormField 111 }}} 112 to this 113 {{{ 114 #!python 115 from myproject.ajaxfkey.forms import AjaxForeignKeyFormField 116 }}}. 117 103 118 === Screenshot === 104 119