1.3.rst 6.7 KB

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