Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

v0.7.rst 14KB

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