Open Source CRM developed on Django framework with REST API for contact, lead, account, and opportunity management
Task and to-do management system for organizing work items with priority levels, due dates, assignments, status tracking, and integration with accounts, contacts, and other CRM entities.
List and search tasks with comprehensive filtering options.
def list_tasks(title: str = None, status: str = None, priority: str = None,
assigned_to: str = None, account: str = None, due_date: str = None,
limit: int = 10, offset: int = 0) -> dict:
"""
List tasks with filtering and search.
Args:
title (str, optional): Filter by task title (partial match)
status (str, optional): Filter by status ('New', 'In Progress', 'Completed')
priority (str, optional): Filter by priority ('Low', 'Normal', 'High', 'Urgent')
assigned_to (str, optional): Filter by assigned user UUID
account (str, optional): Filter by associated account UUID
due_date (str, optional): Filter by due date (YYYY-MM-DD)
limit (int): Number of results per page (default: 10)
offset (int): Number of results to skip (default: 0)
Returns:
dict: Paginated tasks with metadata
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
GET /api/tasks/?status=In%20Progress&priority=High&limit=5
Response:
{
"count": 15,
"next": "/api/tasks/?limit=5&offset=5",
"previous": null,
"results": [
{
"id": "task-uuid",
"title": "Follow up on proposal",
"status": "In Progress",
"priority": "High",
"due_date": "2023-02-15",
"account": "account-uuid",
"contacts": ["contact1-uuid", "contact2-uuid"],
"created_on": "2023-01-15T10:30:00Z",
"assigned_to": ["user1-uuid"],
"teams": ["team1-uuid"]
}
]
}
"""Create new tasks with priority, due dates, and entity associations.
def create_task(task_data: dict) -> dict:
"""
Create a new task.
Args:
task_data (dict): Task information and associations
Returns:
dict: Created task details
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Content-Type: multipart/form-data (if including attachments)
Example:
POST /api/tasks/
{
"title": "Review contract proposal",
"status": "New",
"priority": "High",
"due_date": "2023-02-20",
"account": "account-uuid",
"contacts": ["contact1-uuid"],
"assigned_to": ["user1-uuid"],
"teams": ["team1-uuid"]
}
Response:
{
"id": "new-task-uuid",
"title": "Review contract proposal",
"status": "New",
"priority": "High",
"due_date": "2023-02-20",
...task details...
}
"""Get comprehensive task information and perform updates.
def get_task(pk: str) -> dict:
"""
Get detailed task information.
Args:
pk (str): Task UUID
Returns:
dict: Complete task details with related entities
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
GET /api/tasks/task-uuid/
Response:
{
"task_obj": {
"id": "task-uuid",
"title": "Follow up on proposal",
"status": "In Progress",
"priority": "High",
"due_date": "2023-02-15",
"account": "account-uuid",
"contacts": ["contact1-uuid"],
"created_on": "2023-01-15T10:30:00Z",
"created_by": "user-uuid"
},
"assigned_to": [...assigned users...],
"teams": [...assigned teams...],
"comments": [...task comments...],
"attachments": [...task attachments...],
"users_mention": [...users for @mentions...]
}
"""
def update_task(pk: str, task_data: dict) -> dict:
"""
Update task information.
Args:
pk (str): Task UUID
task_data (dict): Updated task information
Returns:
dict: Updated task details
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
PUT /api/tasks/task-uuid/
{
"title": "Review contract proposal - URGENT",
"status": "In Progress",
"priority": "Urgent",
"due_date": "2023-02-10"
}
"""
def delete_task(pk: str) -> None:
"""
Delete a task.
Args:
pk (str): Task UUID
Returns:
None: 204 No Content on success
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
DELETE /api/tasks/task-uuid/
"""Manage comments and file attachments for tasks.
def add_task_comment_or_attachment(pk: str, comment: str = None,
attachment: file = None) -> dict:
"""
Add comment or attachment to task.
Args:
pk (str): Task UUID
comment (str, optional): Comment text
attachment (file, optional): File to attach
Returns:
dict: Success response
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Content-Type: multipart/form-data (for attachments)
Example:
POST /api/tasks/task-uuid/
{
"comment": "Task completed successfully, proposal approved"
}
"""
def edit_task_comment(pk: str, comment: str) -> dict:
"""
Edit a task comment.
Args:
pk (str): Comment UUID
comment (str): Updated comment text
Returns:
dict: Updated comment
Headers Required:
Authorization: Bearer <access_token>
Example:
PUT /api/tasks/comment/comment-uuid/
{
"comment": "Updated status - awaiting final review"
}
"""
def delete_task_comment(pk: str) -> None:
"""
Delete a task comment.
Args:
pk (str): Comment UUID
Returns:
None: 204 No Content on success
Headers Required:
Authorization: Bearer <access_token>
Example:
DELETE /api/tasks/comment/comment-uuid/
"""
def delete_task_attachment(pk: str) -> None:
"""
Delete a task attachment.
Args:
pk (str): Attachment UUID
Returns:
None: 204 No Content on success
Headers Required:
Authorization: Bearer <access_token>
Example:
DELETE /api/tasks/attachment/attachment-uuid/
"""class Task:
"""Task model representing work items and to-dos"""
id: str # UUID
title: str # Required task title
status: str # 'New', 'In Progress', 'Completed'
priority: str # 'Low', 'Normal', 'High', 'Urgent'
due_date: date # Due date for task completion
# Entity associations
account: str # Account UUID (optional)
contacts: list[str] # Contact UUIDs
# Metadata
created_on: datetime
created_by: str # User UUID
org: str # Organization UUID
# Assignments
assigned_to: list[str] # User UUIDs
teams: list[str] # Team UUIDs
class TaskComment:
"""Comments on tasks"""
id: str # UUID
comment: str
task: str # Task UUID
commented_on: datetime
commented_by: str # User UUID
class TaskAttachment:
"""File attachments on tasks"""
id: str # UUID
attachment: str # File path/URL
task: str # Task UUID
created_on: datetime
created_by: str # User UUIDTasks follow a standard workflow with these status options:
Priority levels help organize task importance:
Tasks support multiple search and filter options:
title parameter for partial text matchingassigned_to filtering by user UUIDAll text-based filters support partial matching and are case-insensitive.
Tasks can be associated with and relate to:
This makes tasks central to workflow management and activity tracking across the CRM system.
Install with Tessl CLI
npx tessl i tessl/pypi-django-crm