kopia lustrzana https://github.com/wagtail/wagtail
Document how to limit a page parent to root
Closes #2768 Issue #2768 was created because a way how to limit a page to be only available under the root page was unknown. The implementation has allowed this for a while now, but the issue was not closed (presumably due to missing documentation). The documentation of the `parent_page_types` filed now includes this "special" case.pull/7501/head
rodzic
45b7788c6d
commit
9ae4ab6084
|
@ -256,6 +256,13 @@ In addition to the model fields provided, ``Page`` has many properties and metho
|
|||
class HiddenPage(Page):
|
||||
parent_page_types = []
|
||||
|
||||
To allow for a page to be only created under the root page (e.g. for ``HomePage`` models) set the ``parent_page_type`` to ``['wagtailcore.Page']``.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class HomePage(Page):
|
||||
parent_page_types = ['wagtailcore.Page']
|
||||
|
||||
.. automethod:: can_exist_under
|
||||
|
||||
.. automethod:: can_create_at
|
||||
|
|
Ładowanie…
Reference in New Issue