[Backport] Docs: Fix formatting of command line instructions
Sphinx turned the double dash into a long dash. A user reported issues
with running the command after copy&pasting it.
(cherry picked from commit 90ab1f19f0)
Make proxy_class fields NullCharFields to avoid uniqueness issues
Django has issues with using blank=True and unique=True together on a
CharField, which is why we've introduced the NullCharField. A more
detailed description can be found in it's docstring.
The same problems apply to the proxy_class fields on offer models.
Switching them to NullCharFields should resolve the problem.
Also altered one check for proxy_class to be consistent with the other
checks for an empty proxy class.
Non-critical migration for CommunicationEventType.code
A check for outstanding migrations brought this up. Unfortunately I
can't find a way to instruct South to ignore the parameter. Model
introspection only allows setting what basically is fancy default
values. Parameters like help_text are ignored in South's
USELESS_PATTERNS, but can't be altered.
[Backport] Allow unassigning categories from products
This has been impossible so far. It is easily achieved by setting
can_delete=True on the formset.
I spent some time trying to get the nice solution working, which would
be that assigning an empty category means deleting that ProductCategory
instance. But I haven't found a good solution that avoids problems like
in #1267. I have since come to the conclusion that enabling can_delete
is the right thing to do. One can then explicitly hide the checkbox,
but set the correct hidden field in Javascript on the client side if
an empty value is assigned.
The fields section has been moved from the factory declaration to the
ProductForm Meta class to allow for easier customisation.
Fixes #1289
(cherry picked from commit 3e4c2f73dd)
This has been impossible so far. It is easily achieved by setting
can_delete=True on the formset.
I spent some time trying to get the nice solution working, which would
be that assigning an empty category means deleting that ProductCategory
instance. But I haven't found a good solution that avoids problems like
in #1267. I have since come to the conclusion that enabling can_delete
is the right thing to do. One can then explicitly hide the checkbox,
but set the correct hidden field in Javascript on the client side if
an empty value is assigned.
The fields section has been moved from the factory declaration to the
ProductForm Meta class to allow for easier customisation.
Fixes #1289
Extend tracker pixel to include Python and Django version
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 OSCAR_TRACKING to False.
This Javascript plugin was used to style browser scrollbars in a
cross-platform way. I belief it's better to remove it:
a) It doesn't do anything, at least on my Ubuntu Chrome nor Firefox.
b) I'm sure there's decent reasons why there isn't a cross-platform
way to style scrollbars. It's a liability when it comes to smartphones
and tables, because those scrollbars use a different UI.
c) It's easy to add back again if so desired.
Add support for i18n_patterns and enable for sandbox
This required:
* Moving Django's i18n urls into the main urls.py and outside of the
scope of Oscar's main application class, because they need to live
outside of the scope of i18n_patterns
* Add a language-code stripped version of the current URL to the
template context to get the language switcher working.
I also updated the language switcher code to mimic what is currently
given as an example in Django's docs.
Fixes #797
It is now replaced with a checkout pre-condition that applies to every
checkout view. If someone's basket becomes invalid while they are in
checkout, then they will be redirected back to the basket page.
Data and schema migrations for removing null=True on CharFields
The data migrations convert any field values that are None to ''.
After second thought, the field changes on ProductAttributeValues have
been undone again. It seems more consistent with the other fields.
Align options for Partner.name and order's Line.partner_name field
Partner name's are allowed to be empty, but Line.partner_name wasn't.
This caused orders to fail when the partner name was indeed empty, as
reported in #1206.
So the field options for both have to be identical. Unfortunately, that
means allowing null=True for Line.partner_name. But dropping null=True
from CharFields should be done as a separate effort all over Oscar's
codebase.
Fixes #1206.
Make access check function for dashboard easier to customise
* It can now be specified in OSCAR_DASHBOARD_DEFAULT_ACCESS_FUNCTION
* nav.py and menu.py were split up so that Node can be dynamically
loaded and hence overridden
I recently needed to alter the access function and realised it's not as
easy as I thought.
Ensure "active" offers exclude those that are suspended
This required extending the offer factories to support setting the
start- and end-dates (looking forward to using FactoryBoy now). Some
additional tests were added for the active manager.
Fixes #1128
Remove Product.status field and Contributor models
The Contributor models (Contributor, ContributorRole, ProductContributor
and their abstract versions) were unused and too specific to the book
domain.
Product.status was provided as a convenience, but the real world showed
that more often than not, a different field type is necessary. As adding
a field is much easier than changing the field type, it is removed.
I tried to be conservative and mostly converted SlugFields that have
unique=True set.
For PaymentEventType and CommunicationEventType, it was discovered
that setting unique=True was likely forgotten.
As far as I could tell, no forms needed to be changed as they all
exclude the affected slug fields anyway.
The BooleanField is not used in Oscar core, and not commonly required.
The through-model ProductCategory is empty apart from the two
ForeignKeys, but left in place to allow customising.