|
|
@@ -2,9 +2,26 @@
|
|
2
|
2
|
How to customise an app
|
|
3
|
3
|
=======================
|
|
4
|
4
|
|
|
5
|
|
-A core part of how oscar can be customised is to create a local version of one of
|
|
6
|
|
-oscar's apps so that it can be customised. The way this is done involves a few steps,
|
|
7
|
|
-which are detailed here.
|
|
|
5
|
+A core part of how oscar can be customised is to create a local version of one
|
|
|
6
|
+of oscar's apps so that it can be modified and extended. Creating a local
|
|
|
7
|
+version of an app allows customisation of any of the classes within the
|
|
|
8
|
+corresponding app in oscar.
|
|
|
9
|
+
|
|
|
10
|
+The way this is done involves a few steps, which are detailed here.
|
|
|
11
|
+
|
|
|
12
|
+Method
|
|
|
13
|
+======
|
|
|
14
|
+
|
|
|
15
|
+1. Create an app within your project with the same "app label" as an app in oscar. Eg,
|
|
|
16
|
+ to create a local version of ``oscar.apps.order``, create something like ``myproject.order``.
|
|
|
17
|
+
|
|
|
18
|
+2. Ensure the ``models.py`` in your local app imports all the models from oscar's version::
|
|
|
19
|
+
|
|
|
20
|
+ # models.py
|
|
|
21
|
+ from oscar.apps.order.models import *
|
|
|
22
|
+
|
|
|
23
|
+3. Replace oscar's version of the app with your new version in ``INSTALLED_APPS``.
|
|
|
24
|
+
|
|
8
|
25
|
|
|
9
|
26
|
Worked example
|
|
10
|
27
|
==============
|