0.4.rst 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. =========================
  2. Wagtail 0.4 release notes
  3. =========================
  4. *July 10, 2014*
  5. .. contents::
  6. :local:
  7. :depth: 1
  8. What's new
  9. ==========
  10. Private Pages
  11. ~~~~~~~~~~~~~
  12. Wagtail now supports password protecting pages on the frontend, allowing sections of your website to be made private.
  13. :ref:`private_pages`
  14. Python 3 support
  15. ~~~~~~~~~~~~~~~~
  16. Wagtail now supports Python 3.2, 3.3 and 3.4.
  17. Scheduled publishing
  18. ~~~~~~~~~~~~~~~~~~~~
  19. Editors can now schedule pages to be published or unpublished at specified times.
  20. A new management command has been added (:ref:`publish_scheduled_pages <publish_scheduled>`) to publish pages that have been scheduled by an editor.
  21. Search on QuerySet with Elasticsearch
  22. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  23. It's now possible to perform searches with Elasticsearch on ``PageQuerySet`` objects:
  24. .. code-block:: console
  25. >>> from wagtail.core.models import Page
  26. >>> Page.objects.live().descendant_of(events_index).search("Hello")
  27. [<Page: Event 1>, <Page: Event 2>]
  28. Sitemap generation
  29. ~~~~~~~~~~~~~~~~~~
  30. A new module has been added (``wagtail.contrib.wagtailsitemaps``) which produces XML sitemaps for Wagtail sites.
  31. :ref:`sitemap_generation`
  32. Front-end cache invalidation
  33. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  34. A new module has been added (``wagtail.contrib.wagtailfrontendcache``) which invalidates pages in a frontend cache when they are updated or deleted in Wagtail.
  35. :ref:`frontend_cache_purging`
  36. Notification preferences
  37. ~~~~~~~~~~~~~~~~~~~~~~~~
  38. Users can now decide which notifications they receive from Wagtail using a new "Notification preferences" section located in the account settings.
  39. Minor features
  40. ~~~~~~~~~~~~~~
  41. Core
  42. ----
  43. * Any extra arguments given to ``Page.serve`` are now passed through to ``get_context`` and ``get_template``
  44. * Added ``in_menu`` and ``not_in_menu`` methods to ``PageQuerySet``
  45. * Added ``search`` method to ``PageQuerySet``
  46. * Added ``get_next_siblings`` and ``get_prev_siblings`` to ``Page``
  47. * Added ``page_published`` signal
  48. * Added ``copy`` method to ``Page`` to allow copying of pages
  49. * Added ``construct_whitelister_element_rules`` hook for customizing the HTML whitelist used when saving ``RichText`` fields
  50. * Support for setting a ``subpage_types`` property on ``Page`` models, to define which page types are allowed as subpages
  51. Admin
  52. -----
  53. * Removed the "More" section from the menu
  54. * Added pagination to page listings
  55. * Added a new datetime picker widget
  56. * Updated ``hallo.js`` to version 1.0.4
  57. * Aesthetic improvements to preview experience
  58. * Login screen redirects to dashboard if user is already logged in
  59. * Snippets are now ordered alphabetically
  60. * Added ``init_new_page`` signal
  61. Search
  62. ------
  63. * Added a new way to configure searchable/filterable fields on models
  64. * Added ``get_indexed_objects`` allowing developers to customize which objects get added to the search index
  65. * Major refactor of Elasticsearch backend
  66. * Use ``match`` instead of ``query_string`` queries
  67. * Fields are now indexed in Elasticsearch with their correct type
  68. * Filter fields are no longer included in ``_all``
  69. * Fields with partial matching are now indexed together into ``_partials``
  70. Images
  71. ------
  72. * Added ``original`` as a resizing rule supported by the ``{% image %}`` tag
  73. * ``image`` tag now accepts extra keyword arguments to be output as attributes on the ``img`` tag
  74. * Added an ``attrs`` property to image rendition objects to output ``src``, ``width``, ``height`` and ``alt`` attributes all in one go
  75. Other
  76. -----
  77. * Added styleguide, for Wagtail developers
  78. Bug fixes
  79. ~~~~~~~~~
  80. * Animated GIFs are now coalesced before resizing
  81. * The Wand backend clones images before modifying them
  82. * The admin breadcrumb is now positioned correctly on mobile
  83. * The page chooser breadcrumb now updates the chooser modal instead of linking to Explorer
  84. * Embeds - fixed crash when no HTML field is sent back from the embed provider
  85. * Multiple sites with same hostname but different ports are now allowed
  86. * It is no longer possible to create multiple sites with ``is_default_site = True``
  87. Backwards-incompatible changes
  88. ==============================
  89. ElasticUtils replaced with elasticsearch-py
  90. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  91. If you are using the Elasticsearch backend, you must install the ``elasticsearch`` module into your environment.
  92. .. note::
  93. If you are using an older version of Elasticsearch (< 1.0) you must install ``elasticsearch`` version 0.4.x.
  94. Addition of ``expired`` column may break old data migrations involving pages
  95. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  96. The scheduled publishing mechanism adds an ``expired`` field to wagtailcore.Page, defaulting to False. Any application code working with Page objects should be unaffected, but any code that creates page records using direct SQL, or within existing South migrations using South's frozen ORM, will fail as this code will be unaware of the ``expired`` database column. To fix a South migration that fails in this way, add the following line to the ``'wagtailcore.page'`` entry at the bottom of the migration file:
  97. .. code-block:: python
  98. 'expired': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  99. .. _04_deprecated_features:
  100. Deprecated features
  101. ===================
  102. Template tag libraries renamed
  103. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  104. The following template tag libraries have been renamed:
  105. * ``pageurl`` => ``wagtailcore_tags``
  106. * ``rich_text`` => ``wagtailcore_tags``
  107. * ``embed_filters`` => ``wagtailembeds_tags``
  108. * ``image_tags`` => ``wagtailimages_tags``
  109. The old names will continue to work, but output a ``DeprecationWarning`` - you are advised to update any ``{% load %}`` tags in your templates to refer to the new names.
  110. New search field configuration format
  111. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  112. ``indexed_fields`` is now deprecated and has been replaced by a new search field configuration format called ``search_fields``. See :ref:`wagtailsearch_indexing` for how to define a ``search_fields`` property on your models.
  113. ``Page.route`` method should now return a ``RouteResult``
  114. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  115. Previously, the ``route`` method called ``serve`` and returned an ``HttpResponse`` object. This has now been split up so ``serve`` is called separately and ``route`` must now return a RouteResult object.
  116. If you are overriding ``Page.route`` on any of your page models, you will need to update the method to return a ``RouteResult`` object. The old method of returning an ``HttpResponse`` will continue to work, but this will throw a ``DeprecationWarning`` and bypass the ``before_serve_page`` hook, which means in particular that :ref:`private_pages` will not work on those page types. See :ref:`overriding_route_method`.
  117. Wagtailadmins ``hooks`` module has moved to wagtailcore
  118. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  119. If you use any ``wagtail_hooks.py`` files in your project, you may have an import like: ``from wagtail.wagtailadmin import hooks``
  120. Change this to: ``from wagtail.core import hooks``
  121. Miscellaneous
  122. ~~~~~~~~~~~~~
  123. * ``Page.show_as_mode`` replaced with ``Page.serve_preview``
  124. * ``Page.get_page_modes`` method replaced with ``Page.preview_modes`` property
  125. * ``Page.get_other_siblings`` replaced with ``Page.get_siblings(inclusive=False)``