0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Update documentation for the serve method override so that it does not mention a specific demo site. (#8714)

This commit is contained in:
Sævar Öfjörð Magnússon 2022-06-21 08:13:58 +00:00 committed by GitHub
parent 50200f94c0
commit 9dd4d6c6c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ Overriding the :meth:`~wagtail.models.Page.serve` Method
Wagtail defaults to serving :class:`~wagtail.models.Page`-derived models by passing a reference to the page object to a Django HTML template matching the model's name, but suppose you wanted to serve something other than HTML? You can override the :meth:`~wagtail.models.Page.serve` method provided by the :class:`~wagtail.models.Page` class and handle the Django request and response more directly.
Consider this example from the Wagtail demo site's ``models.py``, which serves an ``EventPage`` object as an iCal file if the ``format`` variable is set in the request:
Consider this example of an ``EventPage`` object which is served as an iCal file if the ``format`` variable is set in the request:
.. code-block:: python