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


Release history Release notifications

Download files

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

Files for django-s-tasks-api, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size django_s_tasks_api-1.0.0-py3-none-any.whl (27.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size django-s-tasks-api-1.0.0.tar.gz (16.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page