No project description provided
Project description
Shuup Onboarding
Add dynamic panels for onboarding purposes in Shuup (specially in Admin).
Installation & Configuration
Install this package
Run pip install shuup_onboarding
and add shuup_onboarding
to INSTALLED_APPS
.
Implement your onboarding steps and add the onboarding middleware
Write some onboarding steps (any number you want) by implementing the OnboardingStep
class, follow a simple example:
class MyInfoStep(OnboardingStep):
identifier = "my_step_id"
title = "My Step Title"
description = "Some description of the step"
template_name = "my_app/step_template.jinja"
def can_skip(self):
return False
def is_done(self):
return self.context.storage.get("my_info")
def is_visible(self):
return True
def get_form(self, **kwargs) -> forms.Form:
return MyStepForm(**kwargs)
def save(self, form):
self.context.storage["my_info"] = form.cleaned_data["info"]
def undo(self):
self.context.storage.pop("my_info", None)
Then, you need to create an unique onboarding process identifier. For a sake of example, let's user my_onboarding_process
as our onboarding identifier.
Now you need to override the base middleware class BaseAdminOnboardingMiddleware
and configure your process id attribute:
class MyCustomOnboardingMiddleware(BaseAdminOnboardingMiddleware):
onboarding_process_id = "my_onboarding_process"
To make the onboarding process load your steps, you must use a special provides key:
onboarding_process:[YOUR_ONBOARDING_PROCESS-ID]
Finally, add your onboarding steps to the provides:
class AppConfig(shuup.apps.AppConfig):
provides = {
"onboarding_process:my_onboarding_process": [
"my_app.onboarding_steps.MyInfoStep",
"my_app.onboarding_steps.FinalStep",
]
Done.
You can find a full working example at Shuup Onboarding Example.
License
Open Software License version 3.0
Copyright
Copyright (c) 2020 Christian Hess
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file shuup_onboarding-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: shuup_onboarding-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13a6ce86da9a25362fd24f152742b31783ad8a4a408f0f4d6cf899eab975edb4 |
|
MD5 | 38512df1071454bc77b4a7fde8303a07 |
|
BLAKE2b-256 | 2299eeb241ca69773995fe6017f083a658eb5fd49af795d81d5023f2fd75d185 |