Ticket #16602: forms_widget.diff
File forms_widget.diff, 4.6 KB (added by , 13 years ago) |
---|
-
docs/ref/forms/widgets.txt
171 171 Django provides a representation of all the basic HTML widgets, plus some 172 172 commonly used groups of widgets: 173 173 174 ``Widget`` 175 ~~~~~~~~~~ 176 174 177 .. class:: Widget 175 178 176 179 This abstract class cannot be rendered, but provides the basic attribute :attr:`~Widget.attrs`. … … 185 188 >>> name.render('name', 'A name') 186 189 u'<input title="Your name" type="text" name="name" value="A name" size="10" />' 187 190 191 ``TextInput`` 192 ~~~~~~~~~~~~~ 188 193 189 194 .. class:: TextInput 190 195 191 196 Text input: ``<input type='text' ...>`` 192 197 198 ``PasswordInput`` 199 ~~~~~~~~~~~~~~~~~ 200 193 201 .. class:: PasswordInput 194 202 195 203 Password input: ``<input type='password' ...>`` … … 206 214 :attr:`~PasswordInput.render_value` was 207 215 changed from ``True`` to ``False`` 208 216 217 ``HiddenInput`` 218 ~~~~~~~~~~~~~~~ 219 209 220 .. class:: HiddenInput 210 221 211 222 Hidden input: ``<input type='hidden' ...>`` 212 223 224 ``MultipleHiddenInput`` 225 ~~~~~~~~~~~~~~~~~~~~~~~ 226 213 227 .. class:: MultipleHiddenInput 214 228 215 229 Multiple ``<input type='hidden' ...>`` widgets. … … 223 237 :attr:`~Field.choices` attribute. If it does, it will override anything 224 238 you set here when the attribute is updated on the :class:`Field`. 225 239 240 ``FileInput`` 241 ~~~~~~~~~~~~~ 242 226 243 .. class:: FileInput 227 244 228 245 File upload input: ``<input type='file' ...>`` 229 246 247 ``ClearableFileInput`` 248 ~~~~~~~~~~~~~~~~~~~~~~ 249 230 250 .. class:: ClearableFileInput 231 251 232 252 .. versionadded:: 1.3 … … 235 255 input to clear the field's value, if the field is not required and has 236 256 initial data. 237 257 258 ``DateInput`` 259 ~~~~~~~~~~~~~ 260 238 261 .. class:: DateInput 239 262 240 263 Date input as a simple text box: ``<input type='text' ...>`` … … 249 272 format found in :setting:`DATE_INPUT_FORMATS` and respects 250 273 :ref:`format-localization`. 251 274 275 ``DateTimeInput`` 276 ~~~~~~~~~~~~~~~~~ 277 252 278 .. class:: DateTimeInput 253 279 254 280 Date/time input as a simple text box: ``<input type='text' ...>`` … … 263 289 format found in :setting:`DATETIME_INPUT_FORMATS` and respects 264 290 :ref:`format-localization`. 265 291 292 ``TimeInput`` 293 ~~~~~~~~~~~~~ 294 266 295 .. class:: TimeInput 267 296 268 297 Time input as a simple text box: ``<input type='text' ...>`` … … 277 306 format found in :setting:`TIME_INPUT_FORMATS` and respects 278 307 :ref:`format-localization`. 279 308 309 ``Textarea`` 310 ~~~~~~~~~~~~ 311 280 312 .. class:: Textarea 281 313 282 314 Text area: ``<textarea>...</textarea>`` 283 315 316 ``CheckboxInput`` 317 ~~~~~~~~~~~~~~~~~ 318 284 319 .. class:: CheckboxInput 285 320 286 321 Checkbox: ``<input type='checkbox' ...>`` … … 292 327 A callable that takes the value of the CheckBoxInput and returns 293 328 ``True`` if the checkbox should be checked for that value. 294 329 330 ``Select`` 331 ~~~~~~~~~~ 332 295 333 .. class:: Select 296 334 297 335 Select widget: ``<select><option ...>...</select>`` … … 302 340 :attr:`~Field.choices` attribute. If it does, it will override anything 303 341 you set here when the attribute is updated on the :class:`Field`. 304 342 343 ``NullBooleanSelect`` 344 ~~~~~~~~~~~~~~~~~~~~~ 345 305 346 .. class:: NullBooleanSelect 306 347 307 348 Select widget with options 'Unknown', 'Yes' and 'No' 308 349 350 ``SelectMultiple`` 351 ~~~~~~~~~~~~~~~~~~ 352 309 353 .. class:: SelectMultiple 310 354 311 355 Similar to :class:`Select`, but allows multiple selection: 312 356 ``<select multiple='multiple'>...</select>`` 313 357 358 ``RadioSelect`` 359 ~~~~~~~~~~~~~~~ 360 314 361 .. class:: RadioSelect 315 362 316 363 Similar to :class:`Select`, but rendered as a list of radio buttons: … … 322 369 ... 323 370 </ul> 324 371 372 ``CheckboxSelectMultiple`` 373 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 374 325 375 .. class:: CheckboxSelectMultiple 326 376 327 377 Similar to :class:`SelectMultiple`, but rendered as a list of check … … 334 384 ... 335 385 </ul> 336 386 387 ``MultiWidget`` 388 ~~~~~~~~~~~~~~~ 389 337 390 .. class:: MultiWidget 338 391 339 392 Wrapper around multiple other widgets. You'll probably want to use this … … 381 434 382 435 An iterable containing the widgets needed. 383 436 437 ``SplitDateTimeWidget`` 438 ~~~~~~~~~~~~~~~~~~~~~~~ 439 384 440 .. class:: SplitDateTimeWidget 385 441 386 442 Wrapper (using :class:`MultiWidget`) around two widgets: :class:`DateInput` … … 396 452 397 453 Similar to :attr:`TimeInput.format` 398 454 455 ``SplitHiddenDateTimeWidget`` 456 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 399 457 400 458 .. class:: SplitHiddenDateTimeWidget 401 459 … … 404 462 405 463 .. currentmodule:: django.forms.extras.widgets 406 464 465 ``SelectDateWidget`` 466 ~~~~~~~~~~~~~~~~~~~~ 467 407 468 .. class:: SelectDateWidget 408 469 409 470 Wrapper around three :class:`~django.forms.Select` widgets: one each for