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

pull/8770/head
Sævar Öfjörð Magnússon 2022-06-21 08:13:58 +00:00 zatwierdzone przez GitHub
rodzic 50200f94c0
commit 9dd4d6c6c4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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