Django

Code

Changeset 7684

Show
Ignore:
Timestamp:
06/17/08 17:45:59 (5 months ago)
Author:
brosner
Message:

newforms-admin: Brought docs/admin.txt up to speed on missing options from ModelAdmin?.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/newforms-admin/docs/admin.txt

    r7683 r7684  
    147147    and you must escape any special HTML characters (such as ampersands) yourself. 
    148148 
     149``filter_horizontal`` 
     150~~~~~~~~~~~~~~~~~~~~~ 
     151 
     152Use a nifty unobtrusive Javascript "filter" interface instead of the 
     153usability-challenged ``<select multiple>`` in the admin form. The value is a 
     154list of fields that should be displayed as a horizontal filter interface. See 
     155``filter_vertical`` to use a vertical interface. 
     156 
     157``filter_vertical`` 
     158~~~~~~~~~~~~~~~~~~~ 
     159 
     160Same as ``filter_horizontal``, but is a vertical display of the filter 
     161interface. 
     162 
    149163``list_display`` 
    150164~~~~~~~~~~~~~~~~ 
     
    342356If this isn't provided, the Django admin will use the model's default ordering. 
    343357 
     358``prepopulated_fields`` 
     359~~~~~~~~~~~~~~~~~~~~~~~ 
     360 
     361Set ``prepopulated_fields`` to a dictionary mapping field names to the fields 
     362it should prepopulate from:: 
     363 
     364    class ArticleAdmin(admin.ModelAdmin): 
     365        prepopulated_fields = {"slug": ("title",)} 
     366 
     367When set the given fields will use a bit of Javascript to populate from the 
     368fields assigned. 
     369 
     370``prepopulated_fields`` doesn't accept DateTimeFields, ForeignKeys nor 
     371ManyToManyFields. 
     372 
    344373``radio_fields`` 
    345374~~~~~~~~~~~~~~~~ 
     
    358387Don't include a field in ``radio_fields`` unless it's a ``ForeignKey`` or has 
    359388``choices`` set. 
     389 
     390``raw_id_fields`` 
     391~~~~~~~~~~~~~~~~~ 
     392 
     393By default, Django's admin uses a select-box interface (<select>) for 
     394fields that are ``ForeignKey``. Sometimes you don't want to incur the 
     395overhead of having to select all the related instances to display in the 
     396drop-down. 
     397 
     398``raw_id_fields`` is a list of fields you would like to change 
     399into a ``Input`` widget for the primary key. 
    360400 
    361401``save_as`` 
  • django/branches/newforms-admin/docs/model-api.txt

    r7669 r7684  
    423423 
    424424Implies ``db_index=True``. 
    425  
    426 Accepts an extra option, ``prepopulate_from``, which is a list of fields 
    427 from which to auto-populate the slug, via JavaScript, in the object's admin 
    428 form:: 
    429  
    430     models.SlugField(prepopulate_from=("pre_name", "name")) 
    431  
    432 ``prepopulate_from`` doesn't accept DateTimeFields, ForeignKeys nor 
    433 ManyToManyFields. 
    434  
    435 The admin represents ``SlugField`` as an ``<input type="text">`` (a 
    436 single-line input). 
    437425 
    438426``SmallIntegerField``