Giter VIP home page Giter VIP logo

oscar-portation's Introduction

Django Oscar Portation

This is an application for django oscar products import/export. Import/export is processed into xlsx files.

Getting Started

  1. Install oscar-portation with pip install oscar-portation

  2. Add portation to INSTALLED_APPS

  3. Next, you should to fork oscar core dashboard app to your folder with apps:

    ./manage.py oscar_fork_app dashboard shop

  4. Then add shop.dashboard to installed apps, like:

	INSTALLED_APPS = [
		...
	    'portation',
	] + get_core_apps(
	    ['shop.dashboard']
	)
  1. Create app.py file inside the shop.dashboard folder.

  2. 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()

  1. Hooray! Now you can visit /dashboard/portation/import/ and /dashboard/portation/export/ to try it.

  2. 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,
	            },
	        ],
	    },
	]

Current Version

Beta

Contributing

Please feel free to send your issues and pull requests.

Lisense

BSD License

oscar-portation's People

Contributors

dima-kov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

oscar-portation's Issues

[Comment] Imports

Nice tool. I see you made a few changes. Kudos!

You should use get_model instead of import.

from oscar.core.loading import get_model

from portation.base import PortationBase


Product = get_model('catalogue', 'Product')
AttributeOption = get_model('catalogue', 'AttributeOption')
ProductAttributeValue = get_model('catalogue', 'ProductAttributeValue')

Please, add example file

Hello.

Good application, you're done, that made it.

Add an example file, for import, that you can use.

Thank you!.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.