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 13KB

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