Skip to main content

django-s-tasks-api is a simple tasks rest api of django.

Project description

django-s-tasks-api

django-s-tasks-api is a simple task and group task rest api of django.

Installation

To install django-s-tasks-api like this:

pip install django-s-tasks-api 

Configuration

We need to hook django-s-tasks-api into our project.

  1. Put s_tasks_api into your INSTALLED_APPS at settings module:

    INSTALLED_APPS = (
        ...,
        'rest_framework',
        'django_filters',
        's_tasks_api',
    )
    
  2. Create s_tasks_api database table and load default data by running:

    python manage.py migrate
    python manage.py loaddata s_tasks_api/fixtures/default_task_status_data.json
    
  3. Add url patterns at project.urls module:

    from s_tasks_api import urls as s_tasks_api_urls
    
    urlpatterns = [
        ...,
        path(r'api/tasks/', include(s_tasks_api_urls))
    ]
    

API

Task Status

List task status

Show task status list.

method: GET
url: /api/tasks/status/
name: s-tasks:status-list
view: s_tasks_api.views.TaskStatusViewSet

Detail task status

Show task status detail.

method: GET
url: /api/tasks/status/<pk>
name: s-tasks:status-detail
view: s_tasks_api.views.TaskStatusViewSet

Add task status

Add task status. Only admin user can use this.

method: POST
url: /api/tasks/status/
parameters: 
{
    'value': 'new status'
}
name: s-tasks:status-list
view: s_tasks_api.views.TaskStatusViewSet

Update task status

Update task status. Only admin can use this.

method: GET
url: /api/tasks/status/<pk>
parameters:
{
    'value': 'changed'
}
name: s-tasks:status-detail
view: s_tasks_api.views.TaskStatusViewSet

Delete task status

Delete task status. Only admin can use this.

method: GET
url: /api/tasks/status/<pk>
name: s-tasks:status-detail
view: s_tasks_api.views.TaskStatusViewSet

Task Tags

This is almost same as Task Status API, so just change status to tags. But Add Tags is allowed to login user not only admin.

Tasks

List tasks

Show tasks list which are created by user or assigned. This is filterable.

method: GET
url: /api/tasks/
filterable_parameters: [
    'title' (contains),
    'detail' (contains),
    'due_date' (less than or equals),
    'completed',
    'status',
    'tag',
]
name: s-tasks:tasks-list
view: s_tasks_api.views.TaskViewSet

Detail tasks

Show tasks detail.

method: GET
url: /api/tasks/<pk>/
name: s-tasks:tasks-detail
view: s_tasks_api.views.TaskViewSet

Add tasks

Add users task.

method: POST
url: /api/tasks/
parameters: 
{
    'title': 'new_task', 
    'detail': 'task detail',
    'due_date': '2099-12-03', 
    'status': 2, 
    'tag': 1
}
name: s-tasks:tasks-list
view: s_tasks_api.views.TaskViewSet

Change task

Change tasks detail.

method: PUT/PATCH
url: /api/tasks/<pk>/
parameters: 
{
    'title': 'changed', 'detail': 'changed detail',
    'due_date': '2100-10-10', 'status': 3, 'tag': 3
}
name: s-tasks:tasks-detail
view: s_tasks_api.views.TaskViewSet

Complete/Un Complete task

Complete or Un Complete task.

method: PATCH
url: /api/tasks/<pk>/complete/   or   /api/tasks/<pk>/un_complete/
parameters: {}
name: s-tasks:tasks-complete   or   s-tasks:tasks-un-complete
view: s_tasks_api.views.TaskViewSet

Group Tasks

List group tasks

Show tasks list in all user's group. This is filterable.

method: GET
url: /api/tasks/group/
filterable_parameters: [
    'title' (contains),
    'detail' (contains),
    'due_date' (less than or equals),
    'completed',
    'status',
    'tag',
    'created_by',
    'assignee',
    'group',
]
name: s-tasks:group-tasks-list
view: s_tasks_api.views.GroupTaskViewSet

Detail group tasks

Show group tasks detail.

method: GET
url: /api/tasks/group/<pk>/
name: s-tasks:group-tasks-detail
view: s_tasks_api.views.GroupTaskViewSet

Add group task

Add group task.

method: POST
url: /api/tasks/create_group_task/
parameters: 
{
    'title': 'new_task', 
    'detail': 'task detail',
    'due_date': '2099-12-03', 
    'status': 2, 
    'tag': 1,
    'group': 2, 
    'assignee': 2,
    'lock_level': 0, 
    'assign_lock_level': 0
}
name: s-tasks:tasks-create-group-task
view: s_tasks_api.views.TaskViewSet

Move task from user's to group's

Move task from user's to group's

method: POST
url: /api/tasks/group/
parameters: 
{
    'task_id': 1,
    'group': 2, 
    'assignee': 2,
    'lock_level': 0, 
    'assign_lock_level': 0
}
name: s-tasks:group-tasks-list
view: s_tasks_api.views.GroupTaskViewSet

Update group task

Update group task. Permission is depends on lock_level and assign_lock_level.

method: PUT/PATCH
url: /api/tasks/group/<pk>/
parameters: 
{
    'title': 'changed', 
    'detail': 'changed detail',
    'due_date': '2100-10-10', 
    'status': 3, 
    'tag': 3,
    'assignee': 2,
    'lock_level': 0, 
    'assign_lock_level': 0
}
name: s-tasks:group-tasks-detail
view: s_tasks_api.views.GroupTaskViewSet

Complete/Un Complete group task

Complete and Un Complete group task. Permission is depends on lock_level.

method: PATCH
url: /api/group/tasks/<pk>/complete/   or   /api/tasks/group/<pk>/un_complete/
parameters: {}
name: s-tasks:group-tasks-complete   or   s-tasks:group-tasks-un-complete
view: s_tasks_api.views.GroupTaskViewSet

Delete group task

Delete group task with task.

method: DELETE
url: /api/tasks/group/<pk>/
name s-tasks:group-tasks-detail
view: s_tasks_api.views.GroupTaskViewSet

Remove group task to user's task

Remove group task to user's task

method: DELETE
url: /api/tasks/group/<pk>/remove_to_my_task/
name s-tasks:group-tasks-remove-to-my-task
view: s_tasks_api.views.GroupTaskViewSet

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-s-tasks-api-1.0.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_s_tasks_api-1.0.0-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file django-s-tasks-api-1.0.0.tar.gz.

File metadata

  • Download URL: django-s-tasks-api-1.0.0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.4

File hashes

Hashes for django-s-tasks-api-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3ae3def2961855b2c2da67cef7b4638b789270066a16c8aeea6b703946e63319
MD5 9a1a78e3cbc03bb58a80da6f2375680c
BLAKE2b-256 3f87ae9db899935c26e8b1c46cd4cf5120749a9c52653ab669d16f20146741b2

See more details on using hashes here.

File details

Details for the file django_s_tasks_api-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: django_s_tasks_api-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.4

File hashes

Hashes for django_s_tasks_api-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1096e92866e87bfb018565ade9d65efdaa4c2a1145682410e7d2649d319a241
MD5 11ffe7eaeda4b89106ba2576e3c6482c
BLAKE2b-256 cb7dff249e4c5eae6d6bc7b32516d67f3c544501c730912a0eb304230ba469b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page