Docs - formatting - clean up whitespace

pull/9780/head
LB Johnston 2022-12-11 15:36:23 +10:00 zatwierdzone przez LB (Ben Johnston)
rodzic 5d78e03084
commit da90061ca8
3 zmienionych plików z 65 dodań i 71 usunięć

Wyświetl plik

@ -195,7 +195,6 @@ Wagtail provides a set of utilities for creating data migrations on StreamField
An add-on package [wagtail-streamfield-migration-toolkit](https://github.com/wagtail/wagtail-streamfield-migration-toolkit) is available, additionally providing limited support for auto-generating migrations.
```
### Why are data migrations necessary?
If you change the block definition of a StreamField on a model that has existing data, you may have to manually alter that data to match the new format.

Wyświetl plik

@ -2,7 +2,7 @@
# StreamField data migration reference
## wagtail.blocks.migrations.migrate\_operation
## wagtail.blocks.migrations.migrate_operation
### MigrateStreamData
@ -69,7 +69,6 @@ Renames all `StreamBlock` children of the given type
The `block_path_str` when using this operation should point to the parent `StreamBlock` which contains the blocks to be renamed, not the block being renamed.
**Attributes**:
- `old_name` _str_ - name of the child block type to be renamed
@ -108,7 +107,6 @@ Removes all `StreamBlock` children of the given type
The `block_path_str` when using this operation should point to the parent `StreamBlock` which contains the blocks to be removed, not the block being removed.
**Attributes**:
- `name` _str_ - name of the child block type to be removed
@ -127,7 +125,6 @@ Removes all `StructBlock` children of the given type
The `block_path_str` when using this operation should point to the parent `StructBlock` which contains the blocks to be removed, not the block being removed.
**Attributes**:
- `name` _str_ - name of the child block type to be removed
@ -146,7 +143,6 @@ Combines `StreamBlock` children of the given type into a new `ListBlock`
The `block_path_str` when using this operation should point to the parent `StreamBlock` which contains the blocks to be combined, not the child block itself.
**Attributes**:
- `block_name` _str_ - name of the child block type to be combined
@ -166,7 +162,6 @@ Combines `StreamBlock` children of the given types into a new `StreamBlock`
The `block_path_str` when using this operation should point to the parent `StreamBlock` which contains the blocks to be combined, not the child block itself.
**Attributes**:
- `block_names` _[str]_ - names of the child block types to be combined
@ -254,7 +249,7 @@ class InvalidBlockDefError(Exception)
Exception for invalid block definitions
#### map\_block\_value
#### map_block_value
```python
def map_block_value(block_value, block_def, block_path, operation, **kwargs)
@ -273,7 +268,7 @@ Maps the value of a block.
Transformed value
#### map\_struct\_block\_value
#### map_struct_block_value
```python
def map_struct_block_value(struct_block_value, block_def, block_path,
@ -292,7 +287,7 @@ Maps each child block in a `StructBlock` value.
- mapped_value: The value of the `StructBlock` after transforming its children.
#### map\_list\_block\_value
#### map_list_block_value
```python
def map_list_block_value(list_block_value, block_def, block_path, **kwargs)
@ -310,7 +305,7 @@ Maps each child block in a `ListBlock` value.
- mapped_value: The value of the `ListBlock` after transforming all the children.
#### apply\_changes\_to\_raw\_data
#### apply_changes_to_raw_data
```python
def apply_changes_to_raw_data(raw_data, block_path_str, operation, streamfield,
@ -340,6 +335,7 @@ block_name = str
```
A block path is either:
- the empty string, in which case the operation should be applied to the top-level stream; or
- a `"."` (period) separated sequence of block names, where block names are the names given to the blocks in the `StreamField` definition.

Wyświetl plik

@ -133,7 +133,6 @@ If these are used within packages or customisations they will need to be updated
| `tab_nav_link` | `{% include 'wagtailadmin/shared/tabs/tab_nav_link.html' with classname="..." %}` | `{% include 'wagtailadmin/shared/tabs/tab_nav_link.html' with classes="..." %}` |
| `side_panel_button` | `{% include 'wagtailadmin/shared/side_panels/includes/side_panel_button.html' with classname="..." %}` | `{% include 'wagtailadmin/shared/side_panels/includes/side_panel_button.html' with classes="..." %}` |
### `InlinePanel` JavaScript function is now a class
The (internal, undocumented) `InlinePanel` JavaScript function, used to initialise client-side behaviour for inline panels, has been converted to a class. Any user code that calls this function should now replace `InlinePanel(...)` calls with `new InlinePanel(...)`. Additionally, child form controls are now initialised automatically, and so it is no longer necessary to call `initChildControls`, `updateChildCount`, `updateMoveButtonDisabledStates` or `updateAddButtonState`.