You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. .. spelling::
  2. pytest
  3. =======================
  4. Oscar 1.1 release notes
  5. =======================
  6. :release: 2015-06-20
  7. Welcome to Oscar 1.1, or the "Bootstrap 3" release. We also squashed
  8. many bugs that were reported in the last seven months, and managed to shed
  9. a lot of compatibility helpers when Django 1.6 support was removed.
  10. Table of contents:
  11. .. contents::
  12. :local:
  13. :depth: 1
  14. .. _compatibility_of_1.1:
  15. Compatibility
  16. -------------
  17. Oscar 1.1 is compatible with Django 1.7 and 1.8 as well as Python 2.7,
  18. 3.3 and 3.4. Support for Django 1.6, and hence South for migrations, has been
  19. removed.
  20. .. _new_in_1.1:
  21. What's new in Oscar 1.1?
  22. ------------------------
  23. * The frontend and backend templates have been updated to use Bootstrap 3
  24. instead of version 2 (`#1576`_). The frontend and backend templates are now
  25. also independent of each other.
  26. * Category slug, name and URL handling has been refactored to make it easier to
  27. translate categories, and to be able to edit slugs independent of names.
  28. * The icon and caption of `django-tables2` tables can be set directly on the `Table` object, if it
  29. derives from :class:`~oscar.apps.dashboard.tables.DashboardTable`. The caption can be localised
  30. in singular and plural. (`#1482`_)
  31. * Oscar now ships with basic ElasticSearch support.
  32. ``OSCAR_PRODUCT_SEARCH_HANDLER`` has been introduced to more easily set the search backend.
  33. * The offer models can now also be customised the same way as was already
  34. possible for the other apps.
  35. * The test suite is now run with the glorious pytest.
  36. .. _`#1576`: https://github.com/django-oscar/django-oscar/pull/1576
  37. .. _`#1482`: https://github.com/django-oscar/django-oscar/pull/1482
  38. .. _minor_changes_in_1.1:
  39. Minor changes
  40. ~~~~~~~~~~~~~
  41. - The `Order.date_placed` field can now be set explicitly rather than using the
  42. `auto_now_add` behaviour (`#1558`_).
  43. - The settings ``OSCAR_BASKET_COOKIE_SECURE`` and ``OSCAR_RECENTLY_VIEWED_COOKIE_SECURE``
  44. are introduced to set the ``secure`` flag on the relevant cookies.
  45. - Previously, all views handled in Oscar's Application class were decorated
  46. with the permissions_required decorator. That decorator would not do
  47. anything if used with an empty set of permissions. But it was raised as an
  48. issue, and now views not requiring permissions are not decorated at all.
  49. - Properly redirect users to the checkout page after a guest user created an
  50. account.
  51. - ``OSCAR_SEARCH_FACETS`` now accepts ``collections.OrderedDict``.
  52. - Oscar now supports varying the tax rate per product.
  53. - Product class options and attributes can now be edited in the dashboard.
  54. - All ``ModelForm`` subclasses now specify the `fields` meta attribute instead of the `excludes` list.
  55. .. _`#1558`: https://github.com/django-oscar/django-oscar/pull/1558
  56. .. _incompatible_changes_in_1.1:
  57. Backwards incompatible changes in 1.1
  58. -------------------------------------
  59. Categories refactor
  60. ~~~~~~~~~~~~~~~~~~~
  61. The Category model contained two denormalisations to improve performance: it
  62. stored the name of the category and it's ancestors in ``full_name``, and the
  63. ``slug`` field did not just contain the category's slug, but also the ones of
  64. its ancestors.
  65. This came with several drawbacks: it was fiddly to move and update categories,
  66. as one had to ensure to update parts of the entire category tree. It also
  67. made it trickier to add model-level translation to categories.
  68. A refactoring removed the denormalisations leading to much simpler logic,
  69. and a light sprinkle of caching for the URLs hopefully leads to a performance
  70. net positive. But unfortunately it did come with some changes:
  71. * Category slug handling is changed. Historically, Oscar always updated the
  72. slug when the name changed. Now a slug is only created if no slug is given,
  73. and an existing slug is never overridden. This means that you can freely
  74. change the slugs, and a name change will not change the category's URL.
  75. * The ``full_name`` field has been *removed* and been replaced by a
  76. ``full_name`` property. Accessing that property incurs one database query to
  77. fetch the ancestors.
  78. * ``Category.get_absolute_url`` is now naively cached, as it's more costly to
  79. generate the URL than before. But as ``ProductCategoryView``, the view
  80. returned in ``get_absolute_url`` only considers the primary key and not the
  81. slug, even a stale cache should lead to the correct category page. But if
  82. you have altered that logic, please be sure to investigate.
  83. Those changes unfortunately do mean a data migration to update the slugs
  84. which *must* be run. Please see the section on migrations below. Please also
  85. ensure that, if you load your categories via fixtures, you update them
  86. accordingly: remove the ``full_name`` field and remove the ancestor's slugs
  87. from the ``slug`` field.
  88. Misc
  89. ~~~~
  90. * The :class:`~oscar.apps.shipping.abstract_models.AbstractWeightBased` shipping
  91. method now allows zero-weight baskets to have a non-zero shipping cost
  92. (`#1565`_). This means that sites that rely on zero-weight baskets having no
  93. change will need to introduce a new weight band that covers this edge case.
  94. * The methods :method:`~oscar.apps.offer.utils.Applicator.apply` and
  95. :method:`~oscar.apps.offer.utils.Applicatior.get_offers` changed their
  96. arguments to `(basket, user=None, request=None)`. (`#1677`_)
  97. .. _`#1565`: https://github.com/django-oscar/django-oscar/pull/1565
  98. .. _`#1677`: https://github.com/django-oscar/django-oscar/pull/1677
  99. Migrations
  100. ~~~~~~~~~~
  101. Migrations will get picked up automatically for apps you haven't customised.
  102. If you have customised any app, please consult the
  103. :doc:`detailed instructions </topics/upgrading>` on how to handle migrations.
  104. .. warning::
  105. This release contains a data migration for category slugs. If you have
  106. forked it, it is critical you run a copy of that migration when upgrading.
  107. .. warning::
  108. This release doesn't include any South migrations, as support for Django
  109. 1.6 has been dropped.
  110. Note, the catalogue app contains a data migration ``0003_data_migration_slugs``.
  111. If you have a forked catalogue app, copy this migration into your project so it
  112. can be applied (or create a data migration that applies the same transformation).
  113. Dependency changes
  114. ------------------
  115. * Oscar now requires `django-treebeard` 3.0.
  116. .. _deprecated_features_in_1.1:
  117. Deprecated features
  118. ~~~~~~~~~~~~~~~~~~~
  119. The following features have been deprecated in this release:
  120. * For backwards compatibility, one can access the ``ProductCategoryView``
  121. without specifying a category PK in the URL. Oscar itself does not
  122. use this any more, and it will be removed with the next version of Oscar.
  123. * ``ProductSearchHandler`` has been renamed to ``SolrProductSearchHandler``.
  124. The old name will be removed in the next version of Oscar.
  125. Removal of deprecated features
  126. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  127. These methods have been removed:
  128. * ``oscar.core.compat.atomic_compat``: Use ``django.db.transaction.atomic``
  129. instead.
  130. * ``oscar.core.loading.import_string``: Use
  131. ``django.utils.module_loading.import_string`` instead.
  132. * ``Product.variants``: Use ``Product.children``
  133. * ``Product.is_top_level``: Use ``Product.is_standalone or self.is_parent``
  134. * ``Product.is_group``: Use ``Product.is_parent``
  135. * ``Product.is_variant``: Use ``Product.is_child``
  136. * ``Product.min_variant_price_incl_tax``: Refactor or use the deprecated
  137. ``Product.min_child_price_incl_tax``.
  138. * ``Product.min_variant_price_excl_tax``: Refactor or use the deprecated
  139. ``Product.min_child_price_excl_tax``.
  140. * ``Strategy.fetch_for_group``: Use ``Strategy.fetch_for_parent``.
  141. * ``Strategy.select_variant_stockrecords``: Use
  142. ``Strategy.select_children_stockrecords``.
  143. * ``Strategy.group_pricing_policy``: Use ``Strategy.parent_pricing_policy``.
  144. * ``Strategy.group_availability_policy``: Use
  145. ``Strategy.parent_availability_policy``.
  146. These instances have been removed:
  147. * ``oscar.app.shop``: Use ``oscar.app.application`` instead.