kopia lustrzana https://github.com/wagtail/wagtail
Explicitly state that required defaults to true on StreamField blocks
rodzic
cc77f8e7d4
commit
addb31c1d6
|
@ -92,14 +92,14 @@ TextBlock
|
|||
|
||||
``wagtail.wagtailcore.blocks.TextBlock``
|
||||
|
||||
A multi-line text input. As with ``CharBlock``, the keyword arguments ``required``, ``max_length``, ``min_length`` and ``help_text`` are accepted.
|
||||
A multi-line text input. As with ``CharBlock``, the keyword arguments ``required`` (default: True), ``max_length``, ``min_length`` and ``help_text`` are accepted.
|
||||
|
||||
EmailBlock
|
||||
~~~~~~~~~~
|
||||
|
||||
``wagtail.wagtailcore.blocks.EmailBlock``
|
||||
|
||||
A single-line email input that validates that the email is a valid Email Address. The keyword arguments ``required`` and ``help_text`` are accepted.
|
||||
A single-line email input that validates that the email is a valid Email Address. The keyword arguments ``required`` (default: True) and ``help_text`` are accepted.
|
||||
|
||||
For an example of ``EmailBlock`` in use, see :ref:`streamfield_personblock_example`
|
||||
|
||||
|
@ -108,7 +108,7 @@ IntegerBlock
|
|||
|
||||
``wagtail.wagtailcore.blocks.IntegerBlock``
|
||||
|
||||
A single-line integer input that validates that the integer is a valid whole number. The keyword arguments ``required``, ``max_value``, ``min_value`` and ``help_text`` are accepted.
|
||||
A single-line integer input that validates that the integer is a valid whole number. The keyword arguments ``required`` (default: True), ``max_value``, ``min_value`` and ``help_text`` are accepted.
|
||||
|
||||
For an example of ``IntegerBlock`` in use, see :ref:`streamfield_personblock_example`
|
||||
|
||||
|
@ -117,14 +117,14 @@ FloatBlock
|
|||
|
||||
``wagtail.wagtailcore.blocks.FloatBlock``
|
||||
|
||||
A single-line Float input that validates that the value is a valid floating point number. The keyword arguments ``required``, ``max_value`` and ``min_value`` are accepted.
|
||||
A single-line Float input that validates that the value is a valid floating point number. The keyword arguments ``required`` (default: True), ``max_value`` and ``min_value`` are accepted.
|
||||
|
||||
DecimalBlock
|
||||
~~~~~~~~~~~~
|
||||
|
||||
``wagtail.wagtailcore.blocks.DecimalBlock``
|
||||
|
||||
A single-line decimal input that validates that the value is a valid decimal number. The keyword arguments ``required``, ``help_text``, ``max_value``, ``min_value``, ``max_digits`` and ``decimal_places`` are accepted.
|
||||
A single-line decimal input that validates that the value is a valid decimal number. The keyword arguments ``required`` (default: True), ``help_text``, ``max_value``, ``min_value``, ``max_digits`` and ``decimal_places`` are accepted.
|
||||
|
||||
For an example of ``DecimalBlock`` in use, see :ref:`streamfield_personblock_example`
|
||||
|
||||
|
@ -141,14 +141,14 @@ A single-line text input that validates a string against a regex expression. The
|
|||
'invalid': "Not a valid library card number."
|
||||
})
|
||||
|
||||
The keyword arguments ``regex``, ``help_text``, ``required``, ``max_length``, ``min_length`` and ``error_messages`` are accepted.
|
||||
The keyword arguments ``regex``, ``help_text``, ``required`` (default: True), ``max_length``, ``min_length`` and ``error_messages`` are accepted.
|
||||
|
||||
URLBlock
|
||||
~~~~~~~~
|
||||
|
||||
``wagtail.wagtailcore.blocks.URLBlock``
|
||||
|
||||
A single-line text input that validates that the string is a valid URL. The keyword arguments ``required``, ``max_length``, ``min_length`` and ``help_text`` are accepted.
|
||||
A single-line text input that validates that the string is a valid URL. The keyword arguments ``required`` (default: True), ``max_length``, ``min_length`` and ``help_text`` are accepted.
|
||||
|
||||
BooleanBlock
|
||||
~~~~~~~~~~~~
|
||||
|
@ -162,7 +162,7 @@ DateBlock
|
|||
|
||||
``wagtail.wagtailcore.blocks.DateBlock``
|
||||
|
||||
A date picker. The keyword arguments ``required``, ``help_text`` and ``format`` are accepted.
|
||||
A date picker. The keyword arguments ``required`` (default: True), ``help_text`` and ``format`` are accepted.
|
||||
|
||||
``format`` (default: None)
|
||||
Date format. This must be one of the recognised formats listed in the `DATE_INPUT_FORMATS <https://docs.djangoproject.com/en/1.10/ref/settings/#std:setting-DATE_INPUT_FORMATS>`_ setting. If not specifed Wagtail will use ``WAGTAIL_DATE_FORMAT`` setting with fallback to '%Y-%m-%d'.
|
||||
|
@ -172,14 +172,14 @@ TimeBlock
|
|||
|
||||
``wagtail.wagtailcore.blocks.TimeBlock``
|
||||
|
||||
A time picker. The keyword arguments ``required`` and ``help_text`` are accepted.
|
||||
A time picker. The keyword arguments ``required`` (default: True) and ``help_text`` are accepted.
|
||||
|
||||
DateTimeBlock
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
``wagtail.wagtailcore.blocks.DateTimeBlock``
|
||||
|
||||
A combined date / time picker. The keyword arguments ``required``, ``help_text`` and ``format`` are accepted.
|
||||
A combined date / time picker. The keyword arguments ``required`` (default: True), ``help_text`` and ``format`` are accepted.
|
||||
|
||||
``format`` (default: None)
|
||||
Date format. This must be one of the recognised formats listed in the `DATETIME_INPUT_FORMATS <https://docs.djangoproject.com/en/1.10/ref/settings/#std:setting-DATETIME_INPUT_FORMATS>`_ setting. If not specifed Wagtail will use ``WAGTAIL_DATETIME_FORMAT`` setting with fallback to '%Y-%m-%d %H:%M'.
|
||||
|
@ -196,7 +196,7 @@ RawHTMLBlock
|
|||
|
||||
``wagtail.wagtailcore.blocks.RawHTMLBlock``
|
||||
|
||||
A text area for entering raw HTML which will be rendered unescaped in the page output. The keyword arguments ``required``, ``max_length``, ``min_length`` and ``help_text`` are accepted.
|
||||
A text area for entering raw HTML which will be rendered unescaped in the page output. The keyword arguments ``required`` (default: True), ``max_length``, ``min_length`` and ``help_text`` are accepted.
|
||||
|
||||
.. WARNING::
|
||||
When this block is in use, there is nothing to prevent editors from inserting malicious scripts into the page, including scripts that would allow the editor to acquire administrator privileges when another administrator views the page. Do not use this block unless your editors are fully trusted.
|
||||
|
@ -206,7 +206,7 @@ BlockQuoteBlock
|
|||
|
||||
``wagtail.wagtailcore.blocks.BlockQuoteBlock``
|
||||
|
||||
A text field, the contents of which will be wrapped in an HTML `<blockquote>` tag pair. The keyword arguments ``required``, ``max_length``, ``min_length`` and ``help_text`` are accepted.
|
||||
A text field, the contents of which will be wrapped in an HTML `<blockquote>` tag pair. The keyword arguments ``required`` (default: True), ``max_length``, ``min_length`` and ``help_text`` are accepted.
|
||||
|
||||
|
||||
ChoiceBlock
|
||||
|
@ -272,28 +272,28 @@ DocumentChooserBlock
|
|||
|
||||
``wagtail.wagtaildocs.blocks.DocumentChooserBlock``
|
||||
|
||||
A control to allow the editor to select an existing document object, or upload a new one. The keyword argument ``required`` is accepted.
|
||||
A control to allow the editor to select an existing document object, or upload a new one. The keyword argument ``required`` (default: True) is accepted.
|
||||
|
||||
ImageChooserBlock
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
``wagtail.wagtailimages.blocks.ImageChooserBlock``
|
||||
|
||||
A control to allow the editor to select an existing image, or upload a new one. The keyword argument ``required`` is accepted.
|
||||
A control to allow the editor to select an existing image, or upload a new one. The keyword argument ``required`` (default: True) is accepted.
|
||||
|
||||
SnippetChooserBlock
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``wagtail.wagtailsnippets.blocks.SnippetChooserBlock``
|
||||
|
||||
A control to allow the editor to select a snippet object. Requires one positional argument: the snippet class to choose from. The keyword argument ``required`` is accepted.
|
||||
A control to allow the editor to select a snippet object. Requires one positional argument: the snippet class to choose from. The keyword argument ``required`` (default: True) is accepted.
|
||||
|
||||
EmbedBlock
|
||||
~~~~~~~~~~
|
||||
|
||||
``wagtail.wagtailembeds.blocks.EmbedBlock``
|
||||
|
||||
A field for the editor to enter a URL to a media item (such as a YouTube video) to appear as embedded media on the page. The keyword arguments ``required``, ``max_length``, ``min_length`` and ``help_text`` are accepted.
|
||||
A field for the editor to enter a URL to a media item (such as a YouTube video) to appear as embedded media on the page. The keyword arguments ``required`` (default: True), ``max_length``, ``min_length`` and ``help_text`` are accepted.
|
||||
|
||||
|
||||
.. _streamfield_staticblock:
|
||||
|
|
Ładowanie…
Reference in New Issue