Changes between Version 12 and Version 13 of AJAXForeignKey


Ignore:
Timestamp:
May 20, 2007, 9:22:23 PM (18 years ago)
Author:
Michael Axiak <axiak@…>
Comment:

Added note about forms2.py

Legend:

Unmodified
Added
Removed
Modified
  • AJAXForeignKey

    v12 v13  
    22
    33== 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.
     4In 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.
    55
    66== The Solution ==
     
    1818  * {{{__init__.py}}} -- duh
    1919  * {{{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) ]
    2222
    23233. [#Creatingbase_templatesadminbase_site.html Create a base_site.html file in your base_templates/admin directory.]
     
    101101}}}
    102102
     103=== One Last Thing ===
     104
     105If you downloaded {{{ fields.py }}}, you need to make sure the import line at the top correctly imports the Form field.
     106
     107You might need to change this
     108{{{
     109#!python
     110from ajaxfkey.forms import AjaxForeignKeyFormField
     111}}}
     112to this
     113{{{
     114#!python
     115from myproject.ajaxfkey.forms import AjaxForeignKeyFormField
     116}}}.
     117
    103118=== Screenshot ===
    104119
Back to Top