New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

finflo

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

finflo

  • 2.0.44
  • PyPI
  • Socket score

Maintainers
1

KREDIFLO

Your Image Alt Text

A resuable python django package that can handle state transition in your django application .

Description

  • Finflo is designed to carry on FSM transition on your django application .
  • Your state transition's are made easy with finflo
  • customizable Actions and states with on_flow interchangable
  • Pre installed signature levels for each action

TECHNOLOGY STACK

https://www.python.org/ DJANGO DjangoREST

  1. Documentation
  2. Postman collection

Authors

Prerequisite

  • python
  • Django
  • Django-rest-framework

1. Installation

1.1 Initial setup

  • Install finflo using pip
    pip install finflo
  • In your django application , browse to installed_apps section in settings.py and add this ,
INSTALLED_APPS = [
    'finflo',
    'rest_framework'
]
  • Add this in your settings.py
FINFLO = {
    'WORK_MODEL' : ['MyApp.Model','MyApp2.Model2'],
    'PARTY_MODEL' : [] #optional
}
  • The PARTY_TYPE is optional , if it is not needed you can leave it as blank like this []

  • Navigate to the middleware section in your settings.py and add the finflo middleware

MIDDLEWARE = [
    'finflo.middleware.TransitionUserMiddleware',
]
  • Now add this peice of code in your urls.py
urlpatterns = [
    path('', include('finflo.urls'))
]

1.2 Migrations

  • once all the steps done from the above section 1.1 .
  • now we can apply the migrations for the database using ,
- python manage.py makemigrations
- python manage.py migrate 

1.3 Re-migrate

  • scenario 1 : if any new values is added to the WORK_MODEL
  • example for scenario 1 :
# see 1.1 

FINFLO = {
    'WORK_MODEL' : ['MyApp.Model','MyApp2.Model2','MyApp3.Model3'],
    'PARTY_TYPE' : ['MyApp1.Model1'] 
}

  • In the above 1.1 , you can see MyApp3.Model3 is newly addded
  • Now you can remigrate the database without droping it simply by the below command .
- python manage.py migrate --fake finflo 0001
- python manage.py migrate finflo 0002

Usage

  1. Once your setup is completed , whenever the objects in WORK_MODEL is created , the finflo automatically creates :

    • Transition manager
    • workflowitems
    • workevents
  2. The transition for each model can be carried out with 2 methods:

    1. Navigate to the url : localhost/transition/

      • in the content section use the format as below and POST
      • {"type" : "MyApp.Model" , "action" : "MyAction" , "t_id" : "1"}
    2. In Postman , pass the following key in body as follows

      • t_id (transition_id)
      • type (model_type)
      • action
      • Example
        Screenshot
  3. Some important information for transition are as follows :

    ArgumentsData_Type
    typestr
    actionstr
    t_idint
    sourcestr
    interimstr
    targetstr
    from_partystr
    to_partystr

API URLS

  1. List of all Url's
Api URL'sMETHODFORM DATAQUERY_PARAMS
localhost/model/GETNONE?type=Model&t_id=1 or
or t_id=1
localhost/transition/POSTaction , type , t_id ,
optional : from_party , to_party ,
source , interim , target
NONE
localhost/transition/reset/POSTtype , t_idNONE
localhost/action/GET , POSTdescription , model ,
from_state ,to_state ,
from_party , to_party , stage_required
?action=MYACTION or
?action=MYACTION&?model=Model
localhost/signatures/GET , POSTname , sub_action_nameNONE
localhost/party-type/GET , POSTdescriptionNONE
localhost/states/GET , POSTdescriptionNONE
localhost/workflowitems/GETNONENONE
localhost/workevents/GETNONENONE

MANUAL TRANSITION

  1. example

        from finflo.transition import FinFlotransition
    
        # create a manual transition 
    
        FinFlotransition(t_id = "some id",type = "example_model",source = "your own state" ,
        interim = "your own state" , target = "your own state" ,
        from_party = "int or str" , to_party =  "int or str" , record_datas = "model_json_data")
        
    

Support

For support, contact

  1. support@venzo.com
  2. anandrajb@venzotechnologies.com

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc