No project description provided
Project description
SCF_FSM_PACKAGE
A resuable django application that can handle transition and workflow's in your project .
Authors
Installation
Install scf_fsm_package with pip
pip install finflo
- In your django application , browse to installed_apps section in settings.py and add finflo
- make sure you have installed DjangoRestFramework
INSTALLED_APPS = [
'finflo',
'rest_framework'
]
if you want party you can customize by adding this finflo section in your settings.py
- from_party and to_party is required to mention the flow is needed to sent from one party to another party
- The MODEL is optional field the user can specify their transition_model in their application
NOTE : The FINFLO section is required
FINFLO = {
'FROM_PARTY' : 'django_app.model_name', # example
'FROM_PARTY' : 'accounts.party',
'TO_PARTY' : 'accounts.party'
'WORK_MODEL' : ['django_app.model_name' , 'django_app.model_name'] # example
'WORK_MODEL' : ['MyApp.Programs' , 'MyApp.Invoices']
}
or else simple mention None ,
FINFLO = {
'FROM_PARTY' : None,
'TO_PARTY' : None,
'WORK_MODEL' : None
}
now navigate to the middleware section and add the finflo middleware
MIDDLEWARE = [
'finflo.middleware.TransitionUserMiddleware',
]
Api urls
In your application's urls.py , you can include finflo's api urls for browsable api's
** make sure that you have installed DjangoRestFramework
Now add this peice of code in your urls.py
urlpatterns = [
path('', include('finflo.urls'))
]
Usage
-
import your transition function
from finflo.transitions import FinFlotransition
-
The transition function requires 4 positional arguments :
-
Arguments Data_Type type str action str stage int t_id (optional) int
Example 1 : generic
from finflo.transition import FinFlotransition
myhandler = FinFlotransition()
# example function
def index():
myhandler.transition(type = "PROGRAM",action = "submit" ,stage = 0)
return HttpResponse({"data"})
Example 2 : customizable
- Browse to /api/transition/
- send your type , action , stage , t_id(optional) in body
Tech Stack
1. Python
2. Django==3.2.5
3. Django-rest-framework
Additional API's
Api urls
Api URL's | METHOD | QUERY_PARAMS |
---|---|---|
localhost/model/ | GET | ?type=PROGRAM |
localhost/action/ | GET | NONE |
localhost/action/ | POST | NONE |
localhost/workflowitems/ | GET | NONE |
localhost/workevents/ | GET | NONE |
Support
For support, email support@venzo.com .
Future
- postgres support
- next_Avail_transitions
- customizable workflowitems and workflowevents
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 Distribution
Built Distribution
File details
Details for the file finflo-1.9.1.tar.gz
.
File metadata
- Download URL: finflo-1.9.1.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbbcdf6661e5c0f8802682a98bd89f8432e3f49bfe8ceab5466ea4fcf788892d |
|
MD5 | e1dd9f2855bfca98db19db4cdf4fe142 |
|
BLAKE2b-256 | dd73bbb9079ff794e99b8332341a9d797a819405b36fe4ff0f3fc5758fbccfe9 |
File details
Details for the file finflo-1.9.1-py3-none-any.whl
.
File metadata
- Download URL: finflo-1.9.1-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d440c6a281afe4ab604a47b48843285425a81a5c9a5346aa33dad0ccd0f93950 |
|
MD5 | aecc42049ce644d2f5fca18595a8d5d5 |
|
BLAKE2b-256 | da7f672255cb590350beae7e9a0059f8b02ea31f540ee5eec345485ef1acb085 |