This is an application for django oscar products import/export. Import/export is processed into xlsx files.
-
Install oscar-portation with
pip install oscar-portation
-
Add
portation
toINSTALLED_APPS
-
Next, you should to fork oscar core
dashboard
app to your folder with apps:./manage.py oscar_fork_app dashboard shop
-
Then add
shop.dashboard
to installed apps, like:
INSTALLED_APPS = [
...
'portation',
] + get_core_apps(
['shop.dashboard']
)
-
Create
app.py
file inside theshop.dashboard
folder. -
Paste code for processing urls:
from django.conf.urls import url
from oscar.apps.dashboard.app import (
DashboardApplication as CoreDashboardApplication)
from portation.app import application
class DashboardApplication(CoreDashboardApplication):
portation_app = application
def get_urls(self):
processed_urls = super(DashboardApplication, self).get_urls()
urls = [
url(r'^portation/', self.portation_app.urls),
]
return processed_urls + self.post_process_urls(urls)
application = DashboardApplication()
-
Hooray! Now you can visit
/dashboard/portation/import/
and/dashboard/portation/export/
to try it. -
Optiaonally, you can add menu items:
OSCAR_DASHBOARD_NAVIGATION += [
{
'label': _('Import/export'),
'icon': 'icon-refresh',
'children': [
{
'label': _('Import'),
'url_name': 'dashboard:portation-import',
'access_fn':
lambda user, url_name, url_args, url_kwargs: user.is_staff,
},
{
'label': _('Export'),
'url_name': 'dashboard:portation-export',
'access_fn':
lambda user, url_name, url_args, url_kwargs: user.is_staff,
},
],
},
]
Beta
Please feel free to send your issues and pull requests.
BSD License