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ů.

v1.0.rst 30KB

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