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.

v0.7.rst 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. =======================
  2. Oscar 0.7 release notes
  3. =======================
  4. :release: 2014-04-29
  5. Welcome to Oscar 0.7!
  6. These release notes cover the :ref:`new features <new_in_0.7>` as well as
  7. :ref:`backwards incompatible changes <incompatible_changes_in_0.7>` that you'll want to be aware of when
  8. upgrading from Oscar 0.6 or earlier.
  9. If you encounter any undocumented issues, please let us know on the `mailing
  10. list`_.
  11. .. _`mailing list`: https://groups.google.com/forum/?fromgroups#!forum/django-oscar
  12. Table of contents:
  13. .. contents::
  14. :local:
  15. :depth: 1
  16. .. _overview_of_0.7:
  17. Overview
  18. ========
  19. Oscar 0.7 is largely a maintenance release, fixing minor issues, merging
  20. long-standing pull requests and other housekeeping.
  21. As part of the clean-up, we have removed a few unused models and model fields,
  22. as well as removing ``null=True`` from a load of ``CharFields`` - so please read the
  23. release notes carefully when upgrading as some schema migrations may need some
  24. care.
  25. Further, ensure you test your checkout implementation carefully after upgrading
  26. as the core Oscar checkout view classes have been reorganised slightly. Any
  27. upgrading work should be minor but be diligent.
  28. .. _compatibility_of_0.7:
  29. Compatibility
  30. =============
  31. Oscar 0.7 has experimental support for Python 3.
  32. Support for Django 1.4 has been dropped, and support for Django 1.6 is
  33. now considered stable.
  34. .. _new_in_0.7:
  35. What's new in Oscar 0.7?
  36. ========================
  37. Search improvements
  38. ~~~~~~~~~~~~~~~~~~~
  39. Several improvements have been made to Oscar's default search functionality:
  40. * Search results can be now be sorted.
  41. * If your search backend supports it, spelling suggestions will be shown if
  42. the original search term doesn't lead to any results.
  43. * Only products are returned by the core search view. Other content types in
  44. your search index are filtered out (`#370`_).
  45. .. _`#370`: https://github.com/django-oscar/django-oscar/issues/370
  46. Extended signals
  47. ~~~~~~~~~~~~~~~~
  48. Oscar's signals have been improved and consolidated, making it easier to hook
  49. into user journeys and extract analytics information.
  50. Changes to existing signals include:
  51. - The :ref:`basket_addition_signal` signal now passes the ``request`` as an additional
  52. kwarg.
  53. - The :ref:`user_registered_signal` signal now passes the ``request`` as an additional
  54. kwarg.
  55. New signals:
  56. - A :ref:`start_checkout_signal` signal is now raised when the customer begins the
  57. checkout process.
  58. See the :doc:`signals docs </ref/signals>` for more details.
  59. Checkout reorganisation
  60. ~~~~~~~~~~~~~~~~~~~~~~~
  61. The checkout classes have been reworked to clean-up how pre-conditions are
  62. enforced. Each view class now has a ``pre_conditions`` attribute which is an
  63. iterable of method names (as strings). Each method is run within the
  64. ``dispatch`` method of the view and will redirect the customer back to the
  65. appropriate view if the check fails.
  66. This change makes pre-conditions easier to customise and simplifies the core
  67. checkout views. Consequently, the following methods are no longer required and
  68. have been removed:
  69. * ``PaymentDetails.get_error_response``
  70. * ``PaymentDetails.can_basket_be_submitted``
  71. Further, the ``PaymentDetailsView`` has been re-organised for extensibility.
  72. For instance, several new methods have been introduced to allow
  73. fine-grained overriding of functionality:
  74. * :func:`~oscar.apps.checkout.views.PaymentDetailsView.handle_payment_details_submission` -
  75. This is responsible for validating any forms submitted from the payment
  76. URL
  77. * :func:`~oscar.apps.checkout.views.PaymentDetailsView.handle_place_order_submission` -
  78. This is responsible for placing an order after a submission from the preview
  79. URL.
  80. * :func:`~oscar.apps.checkout.views.PaymentDetailsView.render_payment_details` -
  81. Render the payment details template.
  82. The implementation of
  83. :func:`~oscar.apps.checkout.views.PaymentDetailsView.submit` has been improved
  84. to handle payment errors in a more customer friendly way. If an exception is
  85. raised during payment, the payment details page is now loaded with the
  86. original forms passed to the template (so form validation errors can be displayed).
  87. Finally, the ``billing_address`` kwarg to
  88. :func:`~oscar.apps.checkout.views.PaymentDetailsView.submit`` has been removed.
  89. If you want to pass a billing address to be saved against the order, then pass
  90. it as part of the ``order_kwargs`` option.
  91. .. _minor_changes_in_0.7:
  92. Minor changes
  93. ~~~~~~~~~~~~~
  94. * Oscar's LESS files now use Bootstrap 2.3.2 (Oscar 0.6 uses 2.1.1).
  95. * The product model now has a
  96. :attr:`~oscar.apps.catalogue.abstract_models.Product.num_approved_reviews`
  97. property to avoid unnecessary SQL queries when rendering templates (`#1299`_)
  98. * Customers can delete their profiles from within their account section.
  99. * Customers are prevented from using short or common passwords when changing
  100. their password in their account (`#1202`_)
  101. * :attr:`~oscar.core.application.Application.permissions_map` now supports more than two
  102. lists to evaluate permissions.
  103. * Formset handling in
  104. :class:`~oscar.apps.dashboard.catalogue.views.ProductCreateUpdateView` has
  105. been simplified and now easily allows adding further formsets.
  106. * Increased required version of Django Haystack to 2.1
  107. * The dashboard's Bootstrap and the Bootstrap JS has been bumped to 2.3.2, the
  108. latest release of version 2.
  109. * The dashboard's category handling now has the ability to directly create
  110. child categories.
  111. * Oscar's error messages now have their own CSS class, ``error-block``
  112. (`ef3ccf08a7`_).
  113. * It is now possible to disable the redirect that happens when a product or
  114. category's slug changed and an old URL is used (`b920f8ba`_).
  115. * :class:`~oscar.apps.payment.forms.BankCardNumberField` now allows specifying
  116. accepted card types (`32b7249`_).
  117. * Several slug fields have been turned into the newly introduced
  118. :class:`~oscar.models.fields.AutoSlugField` to ensure that generated slugs
  119. are unique.
  120. * Widget initialisation can now be prevented with adding the ``no-widget-init``
  121. class. Issues around widget initialisation in the dashboard promotions have
  122. been resolved.
  123. * The access function used to determine dashboard's menu entries' visibility
  124. is now settable via
  125. :doc:`OSCAR_DASHBOARD_DEFAULT_ACCESS_FUNCTION</ref/settings>`.
  126. * Vouchers start and end times are now datetimes instead of dates; allowing
  127. "lunch-time deals" etc.
  128. * Product classes can now be added from the dashboard. Editing options and
  129. attributes is not yet supported though.
  130. * Experimental support for having a language prefix in the URL has been added,
  131. and enabled for the sandbox. This can be achieved by using Django's
  132. `i18n_patterns`_ function in your ``urls.py``. for the sandbox.
  133. See ``sites/sandbox/urls.py`` for an example.
  134. * A basic example for a multi-language sitemap has been added to the sandbox.
  135. * Reasoning about e.g. when it is feasible to drop Python 2.6 or Django 1.5
  136. support is hard without reliable data, hence the tracker pixel has been
  137. extended to submit the Python and Django version in use.
  138. Tracking is still easily disabled by setting ``OSCAR_TRACKING`` to ``False``.
  139. .. _`#1202`: https://github.com/django-oscar/django-oscar/pull/1202
  140. .. _`#1299`: https://github.com/django-oscar/django-oscar/pull/1299
  141. .. _`b920f8ba`: https://github.com/django-oscar/django-oscar/commit/b920f8ba288cd2f19bb167db2a012479ba956397
  142. .. _`ef3ccf08a7`: https://github.com/django-oscar/django-oscar/commit/ef3ccf08a707ae1250cdb8d5f2dc6f721d020dc4
  143. .. _`32b7249`: https://github.com/django-oscar/django-oscar/commit/32b7249e44b40cb1b20d01226f77ae6777a20b91
  144. .. _`i18n_patterns`: https://docs.djangoproject.com/en/dev/topics/i18n/translation/#language-prefix-in-url-patterns
  145. Bugfixes
  146. ~~~~~~~~
  147. * Addresses in non-shipping countries can no longer be selected as default shipping
  148. address anymore (`be04d46639`_).
  149. * Suspended and consumed offers are no longer returned by the "active" offer
  150. manager. (`#1228`_).
  151. * Products can now be removed from categories (`#1289`_).
  152. .. _`#1228`: https://github.com/django-oscar/django-oscar/issues/1228
  153. .. _`#1289`: https://github.com/django-oscar/django-oscar/issues/1289
  154. .. _`be04d46639`: https://github.com/django-oscar/django-oscar/commit/
  155. .. _incompatible_changes_in_0.7:
  156. Backwards incompatible changes in 0.7
  157. =====================================
  158. .. warning::
  159. Fields and models have been removed from Oscar. If you used them, you must
  160. ensure you create/extend the affected models appropriately.
  161. * Oscar has dropped support for Django 1.4. However, if Oscar continues to
  162. support the ``AUTH_PROFILE_MODULE`` setting so sites that use separate
  163. profile models aren't forced to convert to a single user model in order to
  164. use Oscar 0.7.
  165. * ``AbstractProduct.status`` was an unused ``CharField`` provided for convenience
  166. as it's a commonly required field. But a different field type was often
  167. required, and as changing it is much harder than adding a field with the
  168. desired type, the field has been removed.
  169. * ``Contributor``, ``ContributorRole``, the through-model ``ProductContributor``
  170. and their abstract versions have been removed as they were unused and too
  171. specific to the domain of book shops.
  172. * ``ProductCategory.is_canonical`` was an unused ``BooleanField`` and has been
  173. removed.
  174. * ``Order.basket_id`` was a ``PositiveIntegerField`` containing the primary key of the
  175. associated basket. It's been refactored to be a nullable ``ForeignKey`` and
  176. is now called "basket".
  177. * `#1123`_ - The URL structure of ``ProductCreateRedirectView`` has been changed to use
  178. the product class' slug instead of the primary key. It's necessary to update
  179. URLs pointing to that view.
  180. * ``ProductListView`` has been removed as it wasn't needed any more after the
  181. search improvements. The old URL route still works.
  182. * Accessing categories by just slug instead of primary key and slug had been
  183. unofficially deprecated for 0.6, and is removed now.
  184. * `#1251`_ - Form related templates have been refactored. If you've modified
  185. them, your templates might need updating.
  186. * ``django.conf.urls.i18n`` has been removed from Oscar's default URLs. This is
  187. because to get ``i18n_patterns`` working for Oscar, it needs to be defined
  188. outside of the scope of it. If you use i18n, you need to explicitly add the
  189. following line to your main ``urls.py``::
  190. (r'^i18n/', include('django.conf.urls.i18n')),
  191. * jScrollPane, which was used to style the dashboard's scroll bars, has been
  192. removed.
  193. * The methods ``get_error_response`` and ``can_basket_be_submitted`` have been
  194. removed from the ``PaymentDetailsView`` view class in checkout
  195. .. _`#1123`: https://github.com/django-oscar/django-oscar/pull/1123
  196. .. _`#1251`: https://github.com/django-oscar/django-oscar/pull/1251
  197. Removal of features deprecated in 0.6
  198. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  199. * Django 1.4 support has been removed.
  200. * In :class:`~oscar.apps.checkout.mixins.OrderPlacementMixin`, the following methods
  201. have been removed:
  202. - ``create_shipping_address_from_form_fields`` - This is removed as checkout
  203. now requires an unsaved shipping address instance to be passed in (rather
  204. than having it created implicitly).
  205. - ``create_user_address`` - This is replaced by
  206. :meth:`oscar.apps.checkout.mixin.OrderPlacementMixin.update_address_book`.
  207. - ``create_shipping_address_from_user_address``
  208. * The :meth:`oscar.apps.checkout.session.CheckoutSessionData.shipping_method`
  209. has been removed. Instead
  210. :meth:`oscar.apps.checkout.session.CheckoutSessionMixin.get_shipping_address`
  211. provides the same functionality.
  212. Migrations
  213. ~~~~~~~~~~
  214. .. warning::
  215. The reviews app has not been under migration control so far. Please ensure
  216. you follow South's guidelines on how to `convert an app`_. Essentially,
  217. you will have to run: ``$ ./manage.py migrate reviews 0001 --fake``
  218. .. warning::
  219. A lot of Oscar apps have data migrations for CharFields before ``null=True``
  220. is removed in the following schema migration. If you have extended such an
  221. app and use your own migrations, then you will need to first convert
  222. affected ``None``'s to ``''`` yourself; see the data migrations for our
  223. approach.
  224. .. note::
  225. Be sure to read the detailed instructions for
  226. :doc:`handling migrations </topics/upgrading>`.
  227. * Address:
  228. - ``0008`` - Forgotten migration for ``UserAddress.phone_number``
  229. - ``0009`` & ``0010`` - Data and schema migration for removing ``null=True`` on ``CharFields``
  230. * Catalogue:
  231. - ``0014`` - Drops unused ``ProductCategory.is_canonical`` field.
  232. - ``0015`` - Turns a product's UPC field into a :class:`oscar.models.fields.NullCharField`
  233. - ``0016`` - ``AutoSlugField`` for ``AbstractProductClass`` and ``AbstractOption``
  234. - ``0017`` - Removes ``Product.status``, ``Contributor``, ``ContributorRole`` and ``ProductContributor``
  235. - ``0018`` - Set ``on_delete=models.PROTECT`` on ``Product.product_class``
  236. - ``0019`` & ``0020`` - Data and schema migration for removing ``null=True`` on ``CharFields``
  237. * Customer:
  238. - ``0006`` - ``AutoSlugField`` and ``unique=True`` for ``AbstractCommunicationEventType``
  239. - ``0007`` & ``0008`` - Data and schema migration for removing ``null=True`` on ``CharFields``
  240. - ``0009`` - Migration caused by ``CommunicationEventType.code`` separator change
  241. * Offer:
  242. - ``0029`` - ``AutoSlugField`` for ``ConditionalOffer``
  243. - ``0030`` & ``0031`` - Data and schema migration for removing ``null=True`` on ``CharFields``
  244. - ``0032`` - Changing ``proxy_class`` fields to ``NullCharField``
  245. * Order:
  246. - ``0025`` - ``AutoSlugField`` for ``AbstractPaymentEventType`` and AbstractShippingEventType``
  247. - ``0026`` - Allow ``null=True`` and ``blank=True`` for ``Line.partner_name``
  248. - ``0027`` & ``0028`` - Data and schema migration for removing ``null=True`` on ``CharFields``
  249. * Partner:
  250. - ``0011`` - ``AutoSlugField`` for ``AbstractPartner``
  251. - ``0012`` & ``0013`` - Data and schema migration for removing ``null=True`` on ``CharFields``
  252. * Payment:
  253. - ``0003`` - ``AutoSlugField`` and ``unique=True`` for ``AbstractSourceType``
  254. * Promotions:
  255. - ``0004`` & ``0005`` - Data and schema migration for removing ``null=True`` on ``CharFields``
  256. * Shipping:
  257. - ``0006`` - ``AutoSlugField`` for ``ShippingMethod``
  258. * Reviews:
  259. - ``0001`` - Initial migration for reviews application. Make sure to follow
  260. South's guidelines on how to `convert an app`_.
  261. - ``0002`` & ``0003`` - Data and schema migration for removing ``null=True`` on ``CharFields``
  262. * Voucher:
  263. - ``0002`` and ``0003`` - Convert ``[start|end]_date`` to
  264. ``[start|end]_datetime`` (includes data migration).
  265. .. _`convert an app`: http://south.readthedocs.org/en/latest/convertinganapp.html