Changeset 7684
- Timestamp:
- 06/17/08 17:45:59 (5 months ago)
- Files:
-
- django/branches/newforms-admin/docs/admin.txt (modified) (3 diffs)
- django/branches/newforms-admin/docs/model-api.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/newforms-admin/docs/admin.txt
r7683 r7684 147 147 and you must escape any special HTML characters (such as ampersands) yourself. 148 148 149 ``filter_horizontal`` 150 ~~~~~~~~~~~~~~~~~~~~~ 151 152 Use a nifty unobtrusive Javascript "filter" interface instead of the 153 usability-challenged ``<select multiple>`` in the admin form. The value is a 154 list 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 160 Same as ``filter_horizontal``, but is a vertical display of the filter 161 interface. 162 149 163 ``list_display`` 150 164 ~~~~~~~~~~~~~~~~ … … 342 356 If this isn't provided, the Django admin will use the model's default ordering. 343 357 358 ``prepopulated_fields`` 359 ~~~~~~~~~~~~~~~~~~~~~~~ 360 361 Set ``prepopulated_fields`` to a dictionary mapping field names to the fields 362 it should prepopulate from:: 363 364 class ArticleAdmin(admin.ModelAdmin): 365 prepopulated_fields = {"slug": ("title",)} 366 367 When set the given fields will use a bit of Javascript to populate from the 368 fields assigned. 369 370 ``prepopulated_fields`` doesn't accept DateTimeFields, ForeignKeys nor 371 ManyToManyFields. 372 344 373 ``radio_fields`` 345 374 ~~~~~~~~~~~~~~~~ … … 358 387 Don't include a field in ``radio_fields`` unless it's a ``ForeignKey`` or has 359 388 ``choices`` set. 389 390 ``raw_id_fields`` 391 ~~~~~~~~~~~~~~~~~ 392 393 By default, Django's admin uses a select-box interface (<select>) for 394 fields that are ``ForeignKey``. Sometimes you don't want to incur the 395 overhead of having to select all the related instances to display in the 396 drop-down. 397 398 ``raw_id_fields`` is a list of fields you would like to change 399 into a ``Input`` widget for the primary key. 360 400 361 401 ``save_as`` django/branches/newforms-admin/docs/model-api.txt
r7669 r7684 423 423 424 424 Implies ``db_index=True``. 425 426 Accepts an extra option, ``prepopulate_from``, which is a list of fields427 from which to auto-populate the slug, via JavaScript, in the object's admin428 form::429 430 models.SlugField(prepopulate_from=("pre_name", "name"))431 432 ``prepopulate_from`` doesn't accept DateTimeFields, ForeignKeys nor433 ManyToManyFields.434 435 The admin represents ``SlugField`` as an ``<input type="text">`` (a436 single-line input).437 425 438 426 ``SmallIntegerField``
