- Remove outdated material relating to old versions of Django
- State that Oscar assumes that the email field is unique
- Update a number of links to Django documentation.
- Minor fixes to other bits of documentation.
I was tasked to create a product that would be out-of-the-box available to our users, so I added the attributes in a data migration but I had a hard time finding any resource that describes adding options via code and had to dig through Oscar's code on GitHub to figure this out. People would benefit from an addition like this, at least save time from digging through code to figure this out.
Docs: Remove another mention of South for migrations
I found some docs changes in my git stash that seemed useful. We removed
support for support when removing Django 1.6 support, so we can remove
mention of South.
This commit removes a few long deprecated bits in the docs and in
code. It also updates the
release notes to include those removals, and highlights what has been
deprecated in 0.8. And it fixes a Sphinx warning when building the docs.
Registering receivers is a tricky business pre-Django 1.7 as they get
registered at the same time when models get registered, but require the
sending model to already be in the app cache. It's surprising we don't
see more issues!
Recommendations:
* Avoid calls to get_model in modules that get called during app init at
all cost
* Don't use get_model in your own code. Just import directly.
* Switch to Django 1.7 :)
This commit probably fixes the issue in #1205. But get_model calls to
fetch the category, product image and stock record will all fail,
because receivers listen to their signals.
This commit also moves the catalogue receiver into it's own receivers
module, because that's how we do it elsewhere. That won't make a
difference to the issues though.
A custom app needs to inherit from Oscar's app config. This ensures the
correct app label, and that any startup code (receivers, etc.) is
executed.
Per the camp ground rule, the fork_app command has been slightly
refactored.
The recently introduced management command makes customising easier, and
the docs have been updated accordingly. The how-tos could still do with
updating to the new command, but at least the main docs are current.
Docs: Remove how-tos on customising mixins and overriding core class
These days, to override a mixin it is only required to override the
OrderPlacementMixin; overriding the app and view is not necessary. It is
just a generic case of overriding a core class. A dedicated how-to is
thus unnecessary.
As overriding a core class is the general goal of any advanced
customisation, it has been merged into the customisation section, which
has been given an overhaul as well.
The section regarding modifying apps will be re-added as part of a
higher-level "the Oscar application tree" kind of document.
Remove useless entropy-increasing calls of django.conf.urls.patterns
The function essentially does two things:
1. it applies a prefix - the first argument - to the given urls. In no
instance a prefix was given
2. it calls url() for simple tuple or list elements in the given iterable.
Cases where such a tuple or list was passed to patterns have been
replaced by direct calls to url()
2 allowed for both calls to url() and simple tuples to be listed in
get_urls() and similar places. This allowed for unnecessary variation.
Always calling url() makes the url lists look less noisy and more uniform,
allowing the reader to focus on the actual differences of the urls instead
of superfluities.
django.conf.urls.patterns will also undergo deprecation starting from
Django 1.8. This commit anticipates that change.
https://docs.djangoproject.com/en/dev/releases/1.8/#django-conf-urls-patterns
Replace session_strategy template tag with purchase_info_for_product in demo-site temaplates and doc. See https://github.com/tangentlabs/django-oscar/commit/a8a140fa94baa13f778f9a1529de8d5c2b75e3f2
Replace stockrecord_tags with purchase_info_tags in demo-site templates and docs as invented in oscar0.6. See https://github.com/tangentlabs/django-oscar/commit/6341b576bf9fa18c4dc1c78aaa88e174826763f6
The customisation section required some changes as it's not often
necessary to override the root application instance to change URLs or
views of subapps.