Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

v0.8.rst 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. =======================
  2. Oscar 0.8 release notes
  3. =======================
  4. .. warning::
  5. Since v0.8 has not been released yet, these release notes are still a work-in-progress.
  6. Welcome to Oscar 0.8!
  7. Table of contents:
  8. .. contents::
  9. :local:
  10. :depth: 1
  11. .. _overview_of_0.8:
  12. Overview
  13. --------
  14. Oscar now has a demo site customised for the US!
  15. Things that have been heavily rewritten:
  16. - Adding product to the basket
  17. Shipping functionality got a thorough re-working including a new dashboard for
  18. weight-based shipping methods.
  19. Lots of methods deprecated in the 0.6 release have now been removed.
  20. Specifically, the partner "wrapper" functionality is now gone. All price and
  21. availability logic now needs to be handled with strategies.
  22. .. _compatibility_of_0.8:
  23. Compatibility
  24. -------------
  25. This release adds support for Django 1.7. Per our policy of always supporting
  26. two versions of Django, support for Django 1.5 has been dropped.
  27. This release also adds full Python 3.3 and 3.4 support. But due to South
  28. not supporting Python 3, Python 3 support is only supported in combination
  29. with Django 1.7 and it's new migration framework.
  30. .. _new_in_0.8:
  31. What's new in Oscar 0.8?
  32. ------------------------
  33. Customisation just got easier!
  34. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  35. * Oscar's views are now dynamically imported. This means that they can be
  36. overridden like most other classes in Oscar; overriding the related
  37. Application instance is not necessary any more.
  38. * A new management command, ``oscar_fork_app``, has been introduced to help
  39. with the all-to-common pattern of forking an Oscar app to override one of
  40. it's classes.
  41. * The documentation around :doc:`/topics/customisation` has been given an
  42. overhaul to incorporate the changes.
  43. Explicit differentiation of child, parent and stand-alone products
  44. ------------------------------------------------------------------
  45. In some edge cases, it was difficult to decide whether e.g. a product is a
  46. parent product (previously known as group product) without children or a
  47. stand-alone product (which never has children). To make that distinction
  48. easier, a ``structure`` field has been introduced on the ``AbstractProduct``
  49. class. In that process, naming for the three different product structures
  50. has been altered to be:
  51. - A stand alone product. Regular product that lives by itself.
  52. - A child product. All child products have a parent product. They're a
  53. specific version of the parent. Previously known as product variant.
  54. - A parent product. It essentially represents a set of products.
  55. Previously also known as group product.
  56. Some properties and method names have also been updated to the new naming. The
  57. old ones will throw a deprecation warning.
  58. Better handling of child products in product dashboard
  59. ------------------------------------------------------
  60. Together with the changes above, the dashboard experience for child products
  61. has been improved. The difference between a parent product and a stand-alone
  62. product is hidden from the user; a user can now add and remove child products
  63. on any suitable product. When the first child product is added, a stand-alone
  64. product becomes a parent product; and vice versa.
  65. In the front-end, the old name of "product variants" has been kept.
  66. Django 1.7 support
  67. ------------------
  68. Oscar 0.8 comes with support for Django 1.7 out of the box. The app refactor
  69. and the new migration framework are both great improvements to Django. Oscar
  70. now ships with sets of migrations both for South and the new native
  71. migrations framework.
  72. Unfortunately, the changes in Django required a few breaking changes when
  73. upgrading Oscar both for users staying on Django 1.6 and for users upgrading to
  74. Django 1.7 at the same time. These are detailed in the section for
  75. backwards-incompatible changes.
  76. Reworked shipping app
  77. ~~~~~~~~~~~~~~~~~~~~~
  78. Several parts of the shipping app have been altered. The most important change is a
  79. to the API of shipping methods to avoid a potential thread safety issue.
  80. Any existing Oscar sites with custom shipping methods will need to adjust them
  81. to confirm to the new API. The new API and the other changes are detailed below.
  82. See the
  83. :ref:`backwards incompatible changes <incompatible_shipping_changes_in_0.8>`
  84. for the shipping app and the
  85. :doc:`guide to configuring shipping </howto/how_to_configure_shipping>`
  86. for more information.
  87. Dashboard for weight-based shipping methods
  88. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  89. There is a new dashboard for weight-based shipping methods. It isn't enabled by
  90. default as weight-based shipping methods are enabled by default. To add it to
  91. the dashboard menu, include this snippet in your ``OSCAR_DASHBOARD_NAVIGATION``
  92. setting:
  93. .. code-block:: python
  94. OSCAR_DASHBOARD_NAVIGATION = [
  95. ...
  96. {
  97. 'label': _('Shipping charges'),
  98. 'url_name': 'dashboard:shipping-method-list',
  99. },
  100. ...
  101. ]
  102. You'll also need to modify your shipping repository class to return weight-based
  103. shipping methods too.
  104. US demo site
  105. ~~~~~~~~~~~~
  106. To help developers building sites for the US, a new example Oscar site has been
  107. included in the repo. This customises core Oscar to treat all prices as
  108. excluding tax and then calculate and apply taxes once the shipping address is
  109. known.
  110. See :ref:`us_site` for more information.
  111. Basket additions clean-up
  112. ~~~~~~~~~~~~~~~~~~~~~~~~~
  113. The forms and views around adding things to your basket has been vigorously
  114. reworked. This cleans up some very old code there and ensures variant products
  115. are handled in a consistent way.
  116. The changes do require changing the constructor signature of the
  117. ``AddToBasketForm`` - the details are documented in the
  118. :ref:`basket_app_changes`.
  119. Checkout improvements
  120. ~~~~~~~~~~~~~~~~~~~~~
  121. The checkout process now skips payment if the order total is zero (e.g. when
  122. ordering free products or using a voucher). As part of that, checkout views
  123. now evaluate *pre-conditions* (as before) and newly introduced
  124. *skip conditions*. This should make customising the checkout flow easier.
  125. Cleanup around shipping methods
  126. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  127. * The models of the shipping app now have abstract base classes, similar to
  128. the rest of Oscar.
  129. * The legacy ``ShippingMethod`` name of the interface of the shipping app has
  130. been removed. Inherit from ``shipping.base.Base`` for the class instead, and
  131. inherit from ``shipping.abstract_models.AbstractBase`` for model-based
  132. shipping methods.
  133. * ``oscar.apps.shipping.Scales`` has been renamed and moved to
  134. ``oscar.apps.shipping.scales.Scale``, and is now overridable.
  135. * ``WeightBand.upper_limit`` is now a ``DecimalField``, just like the other
  136. weight-related fields.
  137. - Stand-alone product: Products that "stand by themselves", neither have
  138. parent nor children.
  139. - Parent product: An overarching product, previously known as group product.
  140. - Child products: Products related to a common parent product
  141. .. _minor_changes_in_0.8:
  142. Minor changes
  143. ~~~~~~~~~~~~~
  144. * The ``OSCAR_CURRENCY_LOCALE`` setting has been removed. The locale is now
  145. automatically determined from the current language. This ensures prices are
  146. always shown in the correct format when switching languages.
  147. * The login and registration view now redirects staff users to the dashboard
  148. after logging in. It also employs flash messages to welcome returning and
  149. newly registered users.
  150. * The basket middleware now assigns a ``basket_hash`` attribute to the
  151. ``request`` instance. This provides a hook for basket caching.
  152. * The tracking pixel now also reports the Oscar version in use. This was
  153. forgotten when adding tracking of the Python and Django version in 0.7.
  154. Total information collected now is the versions of Django, Python and Oscar.
  155. * ``OSCAR_SLUG_FUNCTION`` now accepts both string notation and a callable.
  156. * The default templates now allow the order status to be changed on the
  157. dashboard order detail page.
  158. * The forms for the order dashboard views are now loaded dynamically so they
  159. can be overridden.
  160. * Introduced a ``OSCAR_DELETE_IMAGE_FILES`` settings which makes deleting
  161. image files and thumbnails upon deleting of a model with an ``ImageField``
  162. optional. It usually is desired behaviour, but can slow down an app when
  163. using a remote storage.
  164. * Oscar now ships with a ``oscar_populate_countries`` management command to
  165. populate the country databases. It replaces the ``countries.json`` fixture.
  166. The command relies on the ``pycountry`` library being installed.
  167. * It is now possible to use product attributes to add a relation to arbitrary
  168. model instances. There was some (presumably broken) support for it before,
  169. but you should now be able to use product attributes of type ``entity`` as
  170. expected. There's currently no frontend or dashboard support for it, as there
  171. is no good default behaviour.
  172. * Oscar has a new dependency, django-tables2_. It's a handy library that helps
  173. when displaying tabular data, allowing sorting, etc. It also makes it easier
  174. to adapt e.g. the product list view in the dashboard to additional fields.
  175. * ``jquery-ui-datepicker`` has been replaced in the dashboard by
  176. bootstrap-datetimepicker_. We still ship with ``jquery-ui-datepicker`` and
  177. ``JQuery UI`` as it's in use in the frontend.
  178. .. _django-tables2: http://django-tables2.readthedocs.org/en/latest/
  179. .. _bootstrap-datetimepicker: http://www.malot.fr/bootstrap-datetimepicker/
  180. .. _incompatible_changes_in_0.8:
  181. Backwards incompatible changes in 0.8
  182. -------------------------------------
  183. Migrations
  184. ~~~~~~~~~~
  185. * South is not a dependency of Oscar anymore: This means it won't get installed
  186. automatically when you install Oscar. If you are on Django 1.6 and want to
  187. use South, you will need to explicitly install it and add it to your
  188. requirements.
  189. * Only South >= 1.0 is supported: South 1.0 is a backwards compatible release
  190. explicitly released to help with the upgrade path to Django 1.7. Please make
  191. sure you update accordingly if you intend to keep using South. Older versions
  192. of South will look in the wrong directories and will break with this Oscar
  193. release.
  194. * Rename your South ``migrations`` directories: To avoid
  195. clashes between Django's migrations and South's migrations, you should rename
  196. all your South migrations directories (including those of forked Oscar apps)
  197. to ``south_migrations``. South 1.0 will check those first before falling back
  198. to ``migrations``.
  199. * Upgrading to new-style migrations: If you're upgrading to Django 1.7, you
  200. will need to follow the `instructions to upgrade from South`_ for your own
  201. apps. For any forked Oscar apps, you will need to copy Oscar's initial
  202. migrations into your emptied ``migrations`` directory first, because Oscar's
  203. set of migrations depend on each other. You can then create migrations for
  204. your changes by calling ``./manage.py makemigrations``. Django should
  205. detect that the database layout already matches the state of migrations; so
  206. a call to ``migrate`` should fake the migrations.
  207. .. _instructions to upgrade from South: https://docs.djangoproject.com/en/1.7/topics/migrations/#upgrading-from-south
  208. Product structure
  209. ~~~~~~~~~~~~~~~~~
  210. Generally, backwards compatibility has been preserved. Those changes are
  211. unavoidable:
  212. * You now need to explicitly set product structure when creating a product;
  213. the default is a stand-alone product.
  214. * The related_name for child products was altered from ``variants`` to
  215. ``children``. A ``variants`` property has been provided (and will throw a
  216. deprecation warning), but if you used the old related name in a query lookup
  217. (e.g. ``products.filter(variants__title='foo')``, you will have to change it
  218. to ``children``.
  219. * Template blocks and CSS classes have been renamed.
  220. The following methods and properties have been deprecated:
  221. * ``Product.is_parent`` - Use ``is_group`` instead.
  222. * ``Product.is_variant`` - Use ``is_child`` instead.
  223. * ``Product.is_top_level`` - Test for ``is_standalone`` and/or ``is_parent`` instead.
  224. * ``Strategy.fetch_for_group`` - Use ``fetch_for_parent`` instead.
  225. * ``Strategy.group_[pricing|availability]_policy`` - Use
  226. ``parent_[pricing|availability]_policy`` instead.
  227. * ``Strategy.select_variant_stockrecords`` - Use
  228. ``select_children_stockrecords`` instead.
  229. Furthermore, CSS classes and template blocks have been updated. Please follow
  230. the following renaming pattern:
  231. * ``variant-product`` becomes ``child-product``
  232. * ``product_variants`` becomes ``child_products``
  233. * ``variants`` becomes ``children``
  234. * ``variant`` becomes ``child``
  235. Product editing
  236. ---------------
  237. The dashboard improvements for child products meant slight changes to both
  238. ``ProductCreateUpdateView`` and ``ProductForm``. Notably, ``ProductForm`` now
  239. gets a ``parent`` kwarg. Please review your customisations for compatibility
  240. with the updated code.
  241. .. _incompatible_shipping_changes_in_0.8:
  242. Shipping
  243. ~~~~~~~~
  244. The shipping method API has been altered to avoid potential thread-safety
  245. issues. Prior to v0.8, shipping methods had a ``set_basket`` method which
  246. allowed a basket instance to be assigned. This was really a crutch to allow
  247. templates to have easy access to shipping charges (as they could be read
  248. straight off the shipping method instance). However, it was also a
  249. design problem as shipping methods could be instantiated at compile-time
  250. leading to a thread safety issue where multiple threads could assign a basket
  251. to the same shipping method instance.
  252. In Oscar 0.8, shipping methods are stateless services that have a method
  253. :func:`~oscar.apps.shipping.methods.Base.calculate` that takes a basket and
  254. returns a ``Price`` instance. New :doc:`template tags </ref/templatetags/>` are
  255. provided that allow these shipping charges to be accessed from templates.
  256. This API change does require quite a few changes as both the shipping method
  257. and shipping charge now need to be passed around separately:
  258. * Shipping methods no longer have ``charge_excl_tax``,
  259. ``charge_incl_tax`` and ``is_tax_known`` properties.
  260. * The :class:`~oscar.apps.order.utils.OrderCreator` class now requires the
  261. ``shipping_charge`` to be passed to ``place_order``.
  262. * The signature of the :class:`~oscar.apps.checkout.calculators.OrderTotalCalculator`
  263. class has changed to accept ``shipping_charge`` rather than a
  264. ``shipping_method`` instance.
  265. * The signature of the
  266. :func:`~oscar.apps.checkout.session.CheckoutSessionMixin.get_order_totals`
  267. method has changed to accept the ``shipping_charge`` rather than a
  268. ``shipping_method`` instance.
  269. Another key change is in the shipping repository object. The
  270. ``get_shipping_methods`` method has been split in two to simplify the exercise
  271. of providing new shipping methods. The best practice for Oscar 0.8 is to
  272. override the ``methods`` attribute if the same set of shipping methods is
  273. available to everyone:
  274. .. code-block:: python
  275. from oscar.apps.shipping import repository, methods
  276. class Standard(methods.FixedPrice):
  277. code = "standard"
  278. name = "Standard"
  279. charge_excl_tax = D('10.00')
  280. class Express(methods.FixedPrice):
  281. code = "express"
  282. name = "Express"
  283. charge_excl_tax = D('20.00')
  284. class Repository(repository.Repository):
  285. methods = [Standard(), Express()]
  286. or to override ``get_available_shipping_methods`` if the available shipping
  287. methods if only available conditionally:
  288. .. code-block:: python
  289. from oscar.apps.shipping import repository
  290. class Repository(repository.Repository):
  291. def get_available_shipping_methods(
  292. self, basket, shipping_addr=None, **kwargs):
  293. methods = [Standard()]
  294. if shipping_addr.country.code == 'US':
  295. # Express only available in the US
  296. methods.append(Express())
  297. return methods
  298. Note that shipping address should be passed around as instances not classes.
  299. Other potentially breaking changes related to shipping include:
  300. * Weight based shipping methods used to have an ``upper_charge`` field which was
  301. returned if no weight band matched. That doesn't work very well in practice,
  302. and has been removed. Instead, charges from bands are now added together to
  303. match the weight of the basket.
  304. * The :class:`~oscar.apps.order.utils.OrderCreator` class no longer defaults to
  305. free shipping: a shipping method and charge have to be explicitly passed in.
  306. * The ``Base`` shipping method class now lives in ``oscar.apps.shipping.methods``.
  307. * The ``find_by_code`` method of the shipping ``Repository`` class has been
  308. removed as it is no longer used.
  309. * The parameters for
  310. :func:`oscar.apps.shipping.respository.Repository.get_shipping_methods`
  311. have been re-ordered to reflect which are the most important.
  312. * The legacy ``ShippingMethod`` name of the interface of the shipping app has
  313. been removed. Inherit from ``shipping.base.Base`` for the class instead, and
  314. inherit from ``shipping.abstract_models.AbstractBase`` for model-based
  315. shipping methods.
  316. * ``oscar.apps.shipping.Scales`` has been renamed and moved to
  317. ``oscar.apps.shipping.scales.Scale``, and is now overridable.
  318. Email address handling
  319. ----------------------
  320. In theory, the local part of an email is case-sensitive. In practice, many
  321. users don't know about this and most email servers don't consider the
  322. capitalisation. Because of this, Oscar now disregards capitalisation when
  323. looking up emails (e.g. when a user logs in).
  324. Storing behaviour is unaltered: When a user's email address is stored (e.g.
  325. when registering or checking out), the local part is unaltered and
  326. the host portion is lowercased.
  327. .. warning::
  328. Those changes mean you might now have multiple users with email addresses
  329. that Oscar considers identical. Please use the new
  330. ``oscar_find_duplicate_emails`` management command to check your database
  331. and deal with any conflicts accordingly.
  332. Django 1.7 support
  333. ------------------
  334. If you have any plans to upgrade to Django 1.7, more changes beyond
  335. addressing migrations are necessary:
  336. * You should be aware that Django 1.7 now enforces uniqueness of app labels.
  337. Oscar dashboard apps now ship with app configs that set their app label
  338. to ``{oldname}_dashboard``.
  339. * If you have forked any Oscar apps, you must add app configs to them, and
  340. have them inherit from the Oscar one. See the appropriate section in
  341. :doc:`/topics/fork_app` for an example.
  342. * Double-check that you address migrations as detailed above.
  343. * Django now enforces that no calls happen to the model registry during
  344. app startup. This mostly means that you should avoid module-level calls to
  345. ``get_model``, as that only works with a fully initialised model registry.
  346. Misc
  347. ~~~~
  348. * The ``oscar_calculate_scores`` command has been `rewritten`_ to use the ORM
  349. instead of raw SQL. That exposed a bug in the previous calculations,
  350. where purchases got weighed less than any other event. When you upgrade,
  351. your total scores will be change. If you rely on the old behaviour,
  352. just extend the ``Calculator`` class and adjust the weights.
  353. * ``Order.order_number`` now has ``unique=True`` set. If order numbers are
  354. not unique in your database, you need to remedy that before migrating. By
  355. default, Oscar creates unique order numbers.
  356. * ``Product.score`` was just duplicating ``ProductRecord.score`` and has been
  357. removed. Use ``Product.stats.score`` instead.
  358. * Oscar has child products to model tightly coupled products, and
  359. ``Product.recommended_products`` to model products that are loosely related
  360. (e.g. used for upselling). ``Product.related_products`` was a
  361. third option that sat somewhere in between, and which was not well supported.
  362. We fear it adds confusion, and in the spirit of keeping Oscar core lean,
  363. has been removed. If you're using it, switch to
  364. ``Product.recommended_products`` or just add the field back to your
  365. custom Product instance and ``ProductForm`` when migrating.
  366. * The ``basket_form`` template tag code has been greatly simplified. Because of
  367. that, the syntax needed to change slightly.
  368. Before: ``{% basket_form request product as basket_form single %}``
  369. After: ``{% basket_form request product 'single' as basket_form %}``
  370. * Product attribute validation has been cleaned up. As part of that, the
  371. trivial ``ProductAttribute.get_validator`` and the unused
  372. ``ProductAttribute.is_value_valid`` methods have been removed.
  373. * The ``RangeProductFileUpload`` model has been moved from the ranges
  374. dashboard app to the offers app. The migrations that have been naively
  375. drop and re-create the model; any data is lost! This is probably not an
  376. issue, as the model is only used while an range upload is in progress. If
  377. you need to keep the data, ensure you migrate it across.
  378. * ``oscar.core.loading.get_model`` now raises a ``LookupError`` instead of an
  379. ``ImportError`` if a model can't be found. That brings it more in line with
  380. what Django does since the app refactor.
  381. * ``CommunicationEventType.category`` was storing a localised string, which
  382. breaks when switching locale. It now uses ``choices`` to map between the
  383. value and a localised string. Unfortunately, if you're using this feature
  384. and not running an English locale, you will need to migrate the existing
  385. data to the English values.
  386. * Support for the ``OSCAR_OFFER_BLACKLIST_PRODUCT`` setting has been removed.
  387. It was only partially supported: it prevented products from being
  388. added to a range, but offers could be applied to the products nonetheless.
  389. To prevent an offer being applied to a product, use ``is_discountable`` or
  390. override ``get_is_discountable`` on your product instances.
  391. * ``Category.get_ancestors`` used to return a list of ancestors and would
  392. default to include itself. For consistency with get_descendants and to avoid
  393. having to slice the results in templates, it now returns a queryset of the
  394. ancestors; use ``Category.get_ancestors_and_itself`` for the old behaviour.
  395. .. _rewritten: https://github.com/tangentlabs/django-oscar/commit/d8b4dbfed17be90846ea4bc47b5f7b39ad944c24
  396. Basket line stockrecords
  397. ~~~~~~~~~~~~~~~~~~~~~~~~
  398. The basket line model got a reference to the stockrecord in Oscar 0.6. The
  399. basket middleware since then updated basket lines to have stockrecords if
  400. one was missing. If any lines are still missing a stockrecord, we'd expect them
  401. to be from from submitted baskets or from old, abandoned baskets.
  402. This updating of basket lines has been removed for 0.8 as it incurs additional
  403. database queries. Oscar 0.8 now also enforces the stockrecord by making it
  404. the ``stockrecord`` field of basket ``Line`` model no longer nullable.
  405. There is a migration that makes the appropriate schema change but, before that
  406. runs, you may need to clean up your ``basket_line`` table to ensure that all
  407. existing null values are replaced or removed.
  408. Here's a simple script you could run before upgrading which should ensure there
  409. are no nulls in your ``basket_line`` table:
  410. .. code-block:: python
  411. from oscar.apps.basket import models
  412. from oscar.apps.partner.strategy import Selector
  413. strategy = Selector().strategy()
  414. lines = models.Line.objects.filter(stockrecord__isnull=True):
  415. for line in lines:
  416. info = strategy.fetch_for_product(line.product)
  417. if line.stockrecord:
  418. line.stockrecord = info.stockrecord
  419. line.save()
  420. else:
  421. line.delete()
  422. * The ``reload_page_response`` method of
  423. :class:`~oscar.apps.dashboard.orders.views.OrderDetailView`
  424. has been renamed to ``reload_page``.
  425. .. _basket_app_changes:
  426. Basket app changes
  427. ~~~~~~~~~~~~~~~~~~
  428. - The ``basket:add`` URL now required the primary key of the "base" product to
  429. be included. This allows the same form to be used for both GET and POST
  430. requests for variant products.
  431. - The ``ProductSelectionForm`` is no longer used and has been removed.
  432. - The constructor of the :class:`~oscar.apps.basket.forms.AddToBasketForm` has
  433. been adjusted to take the basket and the purchase info tuple as parameters
  434. instead of the request instance (c74f57bf_ and 8ba283e8_).
  435. .. _c74f57bf: https://github.com/tangentlabs/django-oscar/commit/c74f57bf434661877f4d2d2259e7e7eb18b34951#diff-d200ac8746274e0307f512af886e1f3eR148
  436. .. _8ba283e8: https://github.com/tangentlabs/django-oscar/commit/8ba283e8c4239e4eff95da5e8097a17ecfadf5f5
  437. Migrations
  438. ~~~~~~~~~~
  439. .. warning::
  440. The catalogue app has a data migration to determine the product structure.
  441. Please double-check it's outcome and make sure to do something similar
  442. if you have forked the catalogue app.
  443. .. note::
  444. The migration numbers below refer to the numbers of the South migrations.
  445. Oscar 0.8 ships with a set of new initial migrations for Django's new
  446. native migrations framework. They include all the changes detailed below.
  447. .. note::
  448. Be sure to read the detailed instructions for
  449. :doc:`handling migrations </topics/upgrading>`.
  450. * Address:
  451. - ``0011`` - ``AbstractAddress.search_text`` turned into a ``TextField``.
  452. - ``0012`` - ``AbstractCountry``: Removed two unused indexes & turns numeric code into ``CharField``
  453. * Catalogue:
  454. - ``0021`` - Add ``unique_together`` to ``ProductAttributeValue``,
  455. ``ProductRecommendation`` and ``ProductCategory``
  456. - ``0022`` - Remove ``Product.score`` field.
  457. - ``0023`` - Drop ``Product.related_products``.
  458. - ``0024`` - Change ``ProductAttributeValue.value_text`` to a ``TextField``
  459. and do entity attribute changes and model deletions.
  460. - ``0025`` & ``0026`` - Schema & data migration to determine and save Product structure.
  461. * Offer:
  462. - ``0033`` - Use an ``AutoSlug`` field for ``Range`` models
  463. - ``0034`` - Add moved ``RangedProductFileUpload`` model.
  464. * Order:
  465. - ``0029`` - Add ``unique_together`` to ``PaymentEventQuantity`` and ``ShippingEventQuantity``
  466. - ``0030`` - Set ``unique=True`` for ``Order.order_number``
  467. - ``0031`` - ``AbstractAddress.search_text`` turned into a ``TextField``.
  468. * Partner:
  469. - ``0014`` - ``AbstractAddress.search_text`` turned into a ``TextField``.
  470. * Promotions:
  471. - ``0006`` - Add ``unique_together`` to ``OrderedProduct``
  472. * Ranges dashboard:
  473. - ``0003`` - Drop ``RangeProductFileUpload`` from ``ranges`` app. This is
  474. a destructive change!
  475. * Shipping:
  476. - ``0007`` - Change ``WeightBand.upper_limit`` from ``FloatField`` to ``DecimalField``
  477. - ``0008`` - Drop ``WeightBased.upper_charge`` field.
  478. .. _deprecated_features_in_0.8:
  479. Removal of deprecated features
  480. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  481. These methods have been removed:
  482. * ``oscar.apps.catalogue.abstract_models.AbstractProduct.has_stockrecord``
  483. * ``oscar.apps.catalogue.abstract_models.AbstractProduct.stockrecord``
  484. * ``oscar.apps.catalogue.abstract_models.AbstractProduct.is_available_to_buy``
  485. * ``oscar.apps.catalogue.abstract_models.AbstractProduct.is_purchase_permitted``
  486. * ``oscar.apps.catalogue.views.get_product_base_queryset``
  487. * ``oscar.apps.partner.abstract_models.AbstractStockRecord.is_available_to_buy``
  488. * ``oscar.apps.partner.abstract_models.AbstractStockRecord.is_purchase_permitted``
  489. * ``oscar.apps.partner.abstract_models.AbstractStockRecord.availability_code``
  490. * ``oscar.apps.partner.abstract_models.AbstractStockRecord.availability``
  491. * ``oscar.apps.partner.abstract_models.AbstractStockRecord.max_purchase_quantity``
  492. * ``oscar.apps.partner.abstract_models.AbstractStockRecord.dispatch_date``
  493. * ``oscar.apps.partner.abstract_models.AbstractStockRecord.lead_time``
  494. * ``oscar.apps.partner.abstract_models.AbstractStockRecord.price_incl_tax``
  495. * ``oscar.apps.partner.abstract_models.AbstractStockRecord.price_tax``
  496. These classes have been removed
  497. * ``oscar.apps.partner.prices.DelegateToStockRecord``
  498. * ``oscar.apps.partner.availability.DelegateToStockRecord``