Changes between Version 15 and Version 16 of AJAXForeignKey


Ignore:
Timestamp:
May 20, 2007, 10:32:50 PM (17 years ago)
Author:
Michael Axiak <axiak@…>
Comment:

Changed wrong link

Legend:

Unmodified
Added
Removed
Modified
  • AJAXForeignKey

    v15 v16  
    1717
    1818  * {{{__init__.py}}} -- duh
    19   * {{{fields.py}}} -- contains the actual model field. (download)
     19  * {{{fields.py}}} -- [#a2.bFixingfields.py contains the actual model field. (download)]
    2020  * {{{forms.py}}}  -- contains the form field. (download '''forms2.py''' and rename)
    21   * {{{views.py}}}  -- [#OneLastThing contains the AJAX view. (download) ]
     21  * {{{views.py}}}  -- contains the AJAX view. (download)
    2222
    23 3. [#Creatingbase_templatesadminbase_site.html Create a base_site.html file in your base_templates/admin directory.]
     233. [#a3.Creatingbase_templatesadminbase_site.html Create a base_site.html file in your base_templates/admin directory.]
    2424
    25 4. [#Modifyurls.py Modify your urls conf to contain the ajax view.]
     254. [#a4.Modifyurls.py Modify your urls conf to contain the ajax view.]
    2626
    27 5. [#Usingitinyourmodels Modify your models to use it correctly.]
     275. [#a5.Usingitinyourmodels Modify your models to use it correctly.]
    2828
    29 === Creating {{{base_templates/admin/base_site.html}}} ===
     29[#Installation (top)]
     30=== 2.b Fixing {{{fields.py}}} ===
     31
     32If you downloaded {{{fields.py}}}, you need to make sure the import line at the top correctly imports the Form field.
     33
     34You might need to change this
     35
     36{{{
     37#!python
     38from ajaxfkey.forms import AjaxForeignKeyFormField
     39}}}
     40to this
     41{{{
     42#!python
     43from myproject.ajaxfkey.forms import AjaxForeignKeyFormField
     44}}}
     45
     46[#Installation (top)]
     47=== 3. Creating {{{base_templates/admin/base_site.html}}} ===
    3048
    3149Put the contents below in a place locatable by {{{'admin/base_site.html'}}} in your setup.
     
    5573}}}
    5674
    57 
    58 === Modify {{{urls.py}}} ===
     75[#Installation (top)]
     76=== 4. Modify {{{urls.py}}} ===
    5977
    6078Put the following in your urls configuration:
     
    6684Change {{{project.ajaxfkey}}} to the path to the views file you created.
    6785
    68 === Using it in your models ===
     86[#Installation (top)]
     87=== 5. Using it in your models ===
    6988
    7089To use, you need to define a {{{ajax_autocomplete(data)}}} (either in {{{Model}}} or {{{Model.objects}}}) and an {{{ajax_str}}}.
     
    101120}}}
    102121
    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 {{{
    110 #!python
    111 from ajaxfkey.forms import AjaxForeignKeyFormField
    112 }}}
    113 to this
    114 {{{
    115 #!python
    116 from myproject.ajaxfkey.forms import AjaxForeignKeyFormField
    117 }}}
    118 
     122[#Installation (top)]
    119123=== Screenshot ===
    120124
Back to Top