1.3.rst 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. =========================
  2. Wagtail 1.3 release notes
  3. =========================
  4. *December 23, 2015*
  5. .. contents::
  6. :local:
  7. :depth: 1
  8. What's new
  9. ==========
  10. Django 1.9 support
  11. ~~~~~~~~~~~~~~~~~~
  12. Wagtail is now compatible with Django 1.9.
  13. Indexing fields across relations in Elasticsearch
  14. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. Fields on related objects can now be indexed in Elasticsearch using the new ``indexed.RelatedFields`` declaration type:
  16. .. code-block:: python
  17. class Book(models.Model, index.Indexed):
  18. ...
  19. search_fields = [
  20. index.SearchField('title'),
  21. index.FilterField('published_date'),
  22. index.RelatedFields('author', [
  23. index.SearchField('name'),
  24. index.FilterField('date_of_birth'),
  25. ]),
  26. ]
  27. # Search books where their author was born after 1950
  28. # Both the book title and the authors name will be searched
  29. >>> Book.objects.filter(author__date_of_birth__gt=date(1950, 1, 1)).search("Hello")
  30. See: :ref:`wagtailsearch_index_relatedfields`
  31. Cross-linked admin search UI
  32. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  33. The search interface in the Wagtail admin now includes a toolbar to quickly switch between different search types - pages, images, documents and users. A new :ref:`register_admin_search_area <register_admin_search_area>` hook is provided for adding new search types to this toolbar.
  34. Minor features
  35. ~~~~~~~~~~~~~~
  36. * Added ``WagtailPageTests``, a helper module to simplify writing tests for Wagtail sites. See :doc:`/advanced_topics/testing`
  37. * Added system checks to check the ``subpage_types`` and ``parent_page_types`` attributes of page models
  38. * Added ``WAGTAIL_PASSWORD_RESET_ENABLED`` setting to allow password resets to be disabled independently of the password management interface (John Draper)
  39. * Submit for moderation notification emails now include the editor name (Denis Voskvitsov)
  40. * Updated fonts for more comprehensive Unicode support
  41. * Added ``.alt`` attribute to image renditions
  42. * The default ``src``, ``width``, ``height`` and ``alt`` attributes can now be overridden by attributes passed to the ``{% image %}`` tag
  43. * Added keyboard shortcuts for preview and save in the page editor
  44. * Added ``Page`` methods ``can_exist_under``, ``can_create_at``, ``can_move_to`` for customising page type business rules
  45. * ``wagtailadmin.utils.send_mail`` now passes extra keyword arguments to Django's ``send_mail`` function (Matthew Downey)
  46. * ``page_unpublish`` signal is now fired for each page that was unpublished by a call to ``PageQuerySet.unpublish()``
  47. * Add ``get_upload_to`` method to ``AbstractImage``, to allow overriding the default image upload path (Ben Emery)
  48. * Notification emails are now sent per user (Matthew Downey)
  49. * Added the ability to override the default manager on Page models
  50. * Added an optional human-friendly ``site_name`` field to sites (Timo Rieber)
  51. * Added a system check to warn developers who use a custom Wagtail build but forgot to build the admin css
  52. * Added success message after updating image from the image upload view (Christian Peters)
  53. * Added a ``request.is_preview`` variable for templates to distinguish between previewing and live (Denis Voskvitsov)
  54. * 'Pages' link on site stats dashboard now links to the site homepage when only one site exists, rather than the root level
  55. * Added support for chaining multiple image operations on the ``{% image %}`` tag (Christian Peters)
  56. * New translations for Arabic, Latvian and Slovak
  57. Bug fixes
  58. ~~~~~~~~~
  59. * Images and page revisions created by a user are no longer deleted when the user is deleted (Rich Atkinson)
  60. * HTTP cache purge now works again on Python 2 (Mitchel Cabuloy)
  61. * Locked pages can no longer be unpublished (Alex Bridge)
  62. * Site records now implement ``get_by_natural_key``
  63. * Creating pages at the root level (and any other instances of the base ``Page`` model) now properly respects the ``parent_page_types`` setting
  64. * Settings menu now opens correctly from the page editor and styleguide views
  65. * ``subpage_types`` / ``parent_page_types`` business rules are now enforced when moving pages
  66. * Multi-word tags on images and documents are now correctly preserved as a single tag (LKozlowski)
  67. * Changed verbose names to start with lower case where necessary (Maris Serzans)
  68. * Invalid images no longer crash the image listing (Maris Serzans)
  69. * ``MenuItem`` ``url`` parameter can now take a lazy URL (Adon Metcalfe, rayrayndwiga)
  70. * Added missing translation tag to InlinePanel 'Add' button (jnns)
  71. * Added missing translation tag to 'Signing in...' button text (Eugene MechanisM)
  72. * Restored correct highlighting behaviour of rich text toolbar buttons
  73. * Rendering a missing image through ImageChooserBlock no longer breaks the whole page (Christian Peters)
  74. * Filtering by popular tag in the image chooser now works when using the database search backend
  75. Upgrade considerations
  76. ======================
  77. Jinja2 template tag modules have changed location
  78. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  79. Due to a change in the way template tags are imported in Django 1.9, it has been necessary to move the Jinja2 template tag modules from "templatetags" to a new location, "jinja2tags". The correct configuration settings to enable Jinja2 templates are now as follows:
  80. .. code-block:: python
  81. TEMPLATES = [
  82. # ...
  83. {
  84. 'BACKEND': 'django.template.backends.jinja2.Jinja2',
  85. 'APP_DIRS': True,
  86. 'OPTIONS': {
  87. 'extensions': [
  88. 'wagtail.core.jinja2tags.core',
  89. 'wagtail.wagtailadmin.jinja2tags.userbar',
  90. 'wagtail.wagtailimages.jinja2tags.images',
  91. ],
  92. },
  93. }
  94. ]
  95. See: :doc:`/reference/jinja2`
  96. ContentType-returning methods in wagtailcore are deprecated
  97. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  98. The following internal functions and methods in ``wagtail.wagtailcore.models``, which return a list of ``ContentType`` objects, have been deprecated. Any uses of these in your code should be replaced by the corresponding new function which returns a list of model classes instead:
  99. * ``get_page_types()`` - replaced by ``get_page_models()``
  100. * ``Page.clean_subpage_types()`` - replaced by ``Page.clean_subpage_models()``
  101. * ``Page.clean_parent_page_types()`` - replaced by ``Page.clean_parent_page_models()``
  102. * ``Page.allowed_parent_page_types()`` - replaced by ``Page.allowed_parent_page_models()``
  103. * ``Page.allowed_subpage_types()`` - replaced by ``Page.allowed_subpage_models()``
  104. In addition, note that these methods now return page types that are marked as ``is_creatable = False``, including the base ``Page`` class. (Abstract models are not included, as before.)