kopia lustrzana https://github.com/wagtail/wagtail
![]() If a developer wanted to have a site-wide base page class, and also have some pages be `RoutablePage`s, a conflict between the automatically generated `page_ptr` fields would occur. ```python from wagtail.wagtailcore.models import Page from wagtail.contrib.wagtailroutablepage.models import RoutablePage class SitePageBase(Page): # common functionality is_abstract = True class Meta: abstract = True class MyPage(RoutablePage, SitePageBase): # This model is invalid pass ``` `RoutablePage` has been changed to be a mixin `RoutablePageMixin`. Page classes can use this to gain the `RoutablePage` functionality while still retaining the ability to subclass other models. A `RoutablePage` class that derives from both `RoutablePageMixin` and `Page` has been left in for backwards compatibility, so old code will continue to function without any modifications. |
||
---|---|---|
.. | ||
_static | ||
contrib_components | ||
core_components | ||
editor_manual | ||
howto | ||
reference | ||
releases | ||
Makefile | ||
README.md | ||
autobuild.sh | ||
conf.py | ||
gettingstarted.rst | ||
index.rst | ||
requirements.txt | ||
support.rst |
README.md
Wagtail docs
These are Sphinx docs, automatically built at http://docs.wagtail.io when the master branch is committed to Github. To build them locally, install Sphinx and the RTD theme:
pip install Sphinx
pip install sphinx-rtd-theme
Then make html
from this directory, and open _build/html/index.html
in your browser.
We've provided a watchdog script (based on @jacobian's snippet) to auto-build your local docs when you save them. Install watchdog:
pip install watchdog
Then run ./autobuild.sh
before you start editing.
The online editor at http://rst.ninjs.org/ is a helpful tool for checking reStructuredText syntax.