Update creating_pages.rst

pull/494/merge
Dave Cranwell 2014-09-01 16:16:15 +01:00
rodzic f0db8082c8
commit 0b3515a916
1 zmienionych plików z 23 dodań i 0 usunięć

Wyświetl plik

@ -147,3 +147,26 @@ In addition to the model fields provided, ``Page`` has many properties and metho
Defines which template file should be used to render the login form for Protected pages using this model. This overrides the default, defined using ``PASSWORD_REQUIRED_TEMPLATE`` in your settings. See :ref:`private_pages`
Tips
~~~~
Friendly model names
--------------------
Make your model names more friendly to users of Wagtail using Django's ``Meta`` class with a ``verbose_name`` e.g
.. code-block:: python
class HomePage(Page):
...
class Meta:
verbose_name = "Homepage"
When users are given a choice of pages to create, the list of page types is generated by splitting your model names on each of their capital letters. Thus a ``HomePage`` model would be named "Home Page" which is a little clumsy. ``verbose_name`` as in the example above, would change this to read "Homepage" which is slightly more conventional.
The above example also ensures the name of the
Describing your models
----------------------