{"id":16411367,"url":"https://github.com/asifpy/django-simpleflow","last_synced_at":"2025-10-15T17:23:58.644Z","repository":{"id":78089806,"uuid":"68680792","full_name":"asifpy/django-simpleflow","owner":"asifpy","description":"Simple workflow engine","archived":false,"fork":false,"pushed_at":"2016-09-20T06:27:21.000Z","size":299,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T04:28:44.182Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asifpy.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-20T06:23:57.000Z","updated_at":"2020-04-20T08:21:16.000Z","dependencies_parsed_at":"2023-03-01T21:15:42.287Z","dependency_job_id":null,"html_url":"https://github.com/asifpy/django-simpleflow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/asifpy/django-simpleflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asifpy%2Fdjango-simpleflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asifpy%2Fdjango-simpleflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asifpy%2Fdjango-simpleflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asifpy%2Fdjango-simpleflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asifpy","download_url":"https://codeload.github.com/asifpy/django-simpleflow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asifpy%2Fdjango-simpleflow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279095719,"owners_count":26102389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T06:45:16.692Z","updated_at":"2025-10-15T17:23:58.582Z","avatar_url":"https://github.com/asifpy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"===================\ndjango-simpleflow\n===================\n\n\nThis is a work-in-progress code branch of `django-simpleflow` as a third-party app, which aims to bring generic workflow engine using `Django`.\n\nPrerequisites\n-------------\n- Django 1.8+\n- Python 2.7+, 3.2+\n- Django Tables2\n\nUsage\n-----\n\n**Add \"simpleflow\" to INSTALLED_APPS**\n\n.. code-block:: python\n\n\tINSTALLED_APPS = {\n\t\t...\n\t\t'django_tables2',\n\t\t'simpleflow'\n\t}\n\n\tPROJECT_NAME = 'YOUR PROJECT NAME'\n\n**Define your process with its states**\n\n.. code-block:: python\n\t\n\tfrom leave.handlers import(\n    \tupdate_leaverequest_after_hr_approval,\n    \tupdate_leaverequest_after_manager_approval\n\t)\n\n\tPROCESS = {\n    \t'initial': {\n        \t'name': 'Manager Approval',\n        \t'on_completion': [update_leaverequest_after_manager_approval],\n        \t'group': 'Manager',\n        \t'next_transition': 'hr_approver'\n        \t# if 'form' is not defined, then simpleflow\n        \t# will use default ApprovalForm\n    \t},\n    \t'hr_approver': {\n        \t'form': HrApprovalForm,\n        \t'name': 'HR Approval',\n        \t'on_completion': [update_leaverequest_after_hr_approval],\n        \t'group': 'HR'\n    \t}\n    }\n\n**Assign the above defined process to the model**\n\n.. code-block:: python\n\n\tfrom simpleflow.models import SimpleFlow\n\tfrom leave import process\n\n\tclass LeaveRequest(SimpleFlow):\n    \t# assign your process here\n    \tPROCESS = process.PROCESS\n\n    \temployee = models.ForeignKey(\n        \tEmployee,\n        \tblank=True,\n        \tnull=True,\n        \trelated_name='leave_requests'\n    \t)\n    \tleave_type = models.CharField(\n       \t\tmax_length=50,\n        \tchoices=[\n            \t('S', 'Sick'),\n            \t('V', 'Vacation'),\n            \t('W', 'Wedding / Marriage'),\n        \t]\n    \t)\n    \tleave_from = models.DateTimeField()\n    \tleave_to = models.DateTimeField()\n\n    \t# trigger simpleflow\n    \tdef submit_for_approval(self):\n    \t\tself.status = \"submitted_for_approval\"\n    \t\tself.save()\n\n    \t\t# start simpleflow\n    \t\t# this will create task for initial state which\n    \t\t# you defined in your PROCESS config\n    \t\tself.start_simpleflow()\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasifpy%2Fdjango-simpleflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasifpy%2Fdjango-simpleflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasifpy%2Fdjango-simpleflow/lists"}