Oscar 0.7 release notes¶
Welcome to Oscar 0.7!
If you encounter any undocumented issues, please let us know on the mailing list.
Table of contents:
Oscar 0.7 is largely a maintenance release, fixing minor issues, merging long-standing pull requests and other housekeeping.
As part of the clean-up, we have removed a few unused models and model fields,
as well as removing
null=True from a load of
CharFields - so please read the
release notes carefully when upgrading as some schema migrations may need some
Further, ensure you test your checkout implementation carefully after upgrading as the core Oscar checkout view classes have been reorganised slightly. Any upgrading work should be minor but be diligent.
Oscar 0.7 has experimental support for Python 3.
Support for Django 1.4 has been dropped, and support for Django 1.6 is now considered stable.
Several improvements have been made to Oscar’s default search functionality:
Search results can be now be sorted.
If your search backend supports it, spelling suggestions will be shown if the original search term doesn’t lead to any results.
Only products are returned by the core search view. Other content types in your search index are filtered out (#370).
Oscar’s signals have been improved and consolidated, making it easier to hook into user journeys and extract analytics information.
Changes to existing signals include:
The basket_addition signal now passes the
requestas an additional kwarg.
The user_registered signal now passes the
requestas an additional kwarg.
A start_checkout signal is now raised when the customer begins the checkout process.
See the signals docs for more details.
The checkout classes have been reworked to clean-up how pre-conditions are
enforced. Each view class now has a
pre_conditions attribute which is an
iterable of method names (as strings). Each method is run within the
dispatch method of the view and will redirect the customer back to the
appropriate view if the check fails.
This change makes pre-conditions easier to customise and simplifies the core checkout views. Consequently, the following methods are no longer required and have been removed:
PaymentDetailsView has been re-organised for extensibility.
For instance, several new methods have been introduced to allow
fine-grained overriding of functionality:
handle_payment_details_submission()- This is responsible for validating any forms submitted from the payment URL
handle_place_order_submission()- This is responsible for placing an order after a submission from the preview URL.
render_payment_details()- Render the payment details template.
The implementation of
submit() has been improved
to handle payment errors in a more customer friendly way. If an exception is
raised during payment, the payment details page is now loaded with the
original forms passed to the template (so form validation errors can be displayed).
billing_address kwarg to
submit`() has been removed.
If you want to pass a billing address to be saved against the order, then pass
it as part of the
Oscar’s LESS files now use Bootstrap 2.3.2 (Oscar 0.6 uses 2.1.1).
The product model now has a
num_approved_reviewsproperty to avoid unnecessary SQL queries when rendering templates (#1299)
Customers can delete their profiles from within their account section.
Customers are prevented from using short or common passwords when changing their password in their account (#1202)
permissions_mapnow supports more than two lists to evaluate permissions.
Formset handling in
ProductCreateUpdateViewhas been simplified and now easily allows adding further formsets.
Increased required version of Django Haystack to 2.1
The dashboard’s Bootstrap and the Bootstrap JS has been bumped to 2.3.2, the latest release of version 2.
The dashboard’s category handling now has the ability to directly create child categories.
Oscar’s error messages now have their own CSS class,
It is now possible to disable the redirect that happens when a product or category’s slug changed and an old URL is used (b920f8ba).
BankCardNumberFieldnow allows specifying accepted card types (32b7249).
Several slug fields have been turned into the newly introduced
AutoSlugFieldto ensure that generated slugs are unique.
Widget initialisation can now be prevented with adding the
no-widget-initclass. Issues around widget initialisation in the dashboard promotions have been resolved.
The access function used to determine dashboard’s menu entries’ visibility is now settable via OSCAR_DASHBOARD_DEFAULT_ACCESS_FUNCTION.
Vouchers start and end times now use
date; allowing “lunch-time deals” etc.
Product classes can now be added from the dashboard. Editing options and attributes is not yet supported though.
Experimental support for having a language prefix in the URL has been added, and enabled for the sandbox. This can be achieved by using Django’s i18n_patterns function in your
urls.py. for the sandbox. See
sandbox/urls.pyfor an example.
A basic example for a multi-language sitemap has been added to the sandbox.
Reasoning about e.g. when it is feasible to drop Python 2.6 or Django 1.5 support is hard without reliable data, hence the tracker pixel has been extended to submit the Python and Django version in use. Tracking is still easily disabled by setting
Fields and models have been removed from Oscar. If you used them, you must ensure you create/extend the affected models appropriately.
Oscar has dropped support for Django 1.4. However, if Oscar continues to support the
AUTH_PROFILE_MODULEsetting so sites that use separate profile models aren’t forced to convert to a single user model in order to use Oscar 0.7.
AbstractProduct.statuswas an unused
CharFieldprovided for convenience as it’s a commonly required field. But a different field type was often required, and as changing it is much harder than adding a field with the desired type, the field has been removed.
ContributorRole, the through-model
ProductContributorand their abstract versions have been removed as they were unused and too specific to the domain of book shops.
ProductCategory.is_canonicalwas an unused
BooleanFieldand has been removed.
PositiveIntegerFieldcontaining the primary key of the associated basket. It’s been refactored to be a nullable
ForeignKeyand is now called “basket”.
#1123 - The URL structure of
ProductCreateRedirectViewhas been changed to use the product class’ slug instead of the primary key. It’s necessary to update URLs pointing to that view.
ProductListViewhas been removed as it wasn’t needed any more after the search improvements. The old URL route still works.
Accessing categories by just slug instead of primary key and slug had been unofficially deprecated for 0.6, and is removed now.
#1251 - Form related templates have been refactored. If you’ve modified them, your templates might need updating.
django.conf.urls.i18nhas been removed from Oscar’s default URLs. This is because to get
i18n_patternsworking for Oscar, it needs to be defined outside of the scope of it. If you use i18n, you need to explicitly add the following line to your main
jScrollPane, which was used to style the dashboard’s scroll bars, has been removed.
can_basket_be_submittedhave been removed from the
PaymentDetailsViewview class in checkout
Removal of features deprecated in 0.6¶
Django 1.4 support has been removed.
OrderPlacementMixin, the following methods have been removed:
create_shipping_address_from_form_fields- This is removed as checkout now requires an unsaved shipping address instance to be passed in (rather than having it created implicitly).
create_user_address- This is replaced by
oscar.apps.checkout.session.CheckoutSessionData.shipping_method()has been removed. Instead
oscar.apps.checkout.session.CheckoutSessionMixin.get_shipping_address()provides the same functionality.
The reviews app has not been under migration control so far. Please ensure
you follow South’s guidelines on how to convert an app. Essentially,
you will have to run:
$ ./manage.py migrate reviews 0001 --fake
A lot of Oscar apps have data migrations for CharFields before
is removed in the following schema migration. If you have extended such an
app and use your own migrations, then you will need to first convert
'' yourself; see the data migrations for our
Be sure to read the detailed instructions for handling migrations.
0008- Forgotten migration for
0010- Data and schema migration for removing
0014- Drops unused
0015- Turns a product’s UPC field into a
0020- Data and schema migration for removing
0008- Data and schema migration for removing
0009- Migration caused by
0031- Data and schema migration for removing
0028- Data and schema migration for removing
0013- Data and schema migration for removing
0005- Data and schema migration for removing
0001- Initial migration for reviews application. Make sure to follow South’s guidelines on how to convert an app.
0003- Data and schema migration for removing
[start|end]_datetime(includes data migration).