0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 19:20:56 +01:00
wagtail/docs/core_components
Tim Heap 15419f4d0e Make RoutablePage a mixin
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.
2014-08-21 19:42:17 +10:00
..
images Update using_images_outside_wagtail.rst 2014-08-19 10:52:49 +01:00
pages Make RoutablePage a mixin 2014-08-21 19:42:17 +10:00
search Added note to say that searching on extra fields with the database backend is not supported 2014-07-29 14:57:29 +01:00
form_builder.rst Added components sections 2014-07-25 15:31:55 +01:00
index.rst Moved frontend image url docs into new images section 2014-07-29 16:35:34 +01:00
snippets.rst Added components sections 2014-07-25 15:31:55 +01:00