0.4.rst 7.2 KB

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