Open Source CRM developed on Django framework with REST API for contact, lead, account, and opportunity management
Calendar event management system for scheduling meetings, calls, and tasks with contact invitations, event types, and comprehensive activity tracking integrated with CRM entities.
List and search events with comprehensive filtering options.
def list_events(name: str = None, event_type: str = None, status: str = None,
assigned_to: str = None, start_date: str = None,
limit: int = 10, offset: int = 0) -> dict:
"""
List events with filtering and search.
Args:
name (str, optional): Filter by event name (partial match)
event_type (str, optional): Filter by type ('Call', 'Meeting', 'Task')
status (str, optional): Filter by event status
assigned_to (str, optional): Filter by assigned user UUID
start_date (str, optional): Filter by start 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 events with metadata
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
GET /api/events/?event_type=Meeting&start_date=2023-02-15&limit=5
Response:
{
"count": 12,
"next": "/api/events/?limit=5&offset=5",
"previous": null,
"results": [
{
"id": "event-uuid",
"name": "Client Strategy Meeting",
"event_type": "Meeting",
"status": "Planned",
"start_date": "2023-02-15",
"start_time": "14:00:00",
"end_date": "2023-02-15",
"contacts": ["contact1-uuid", "contact2-uuid"],
"created_on": "2023-01-15T10:30:00Z",
"assigned_to": ["user1-uuid"],
"teams": ["team1-uuid"]
}
]
}
"""Create new calendar events with scheduling and contact invitations.
def create_event(event_data: dict) -> dict:
"""
Create a new calendar event.
Args:
event_data (dict): Event information and scheduling details
Returns:
dict: Created event details
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Content-Type: multipart/form-data (if including attachments)
Example:
POST /api/events/
{
"name": "Product Demo Call",
"event_type": "Call",
"status": "Planned",
"start_date": "2023-02-20",
"start_time": "10:00:00",
"end_date": "2023-02-20",
"contacts": ["contact1-uuid"],
"assigned_to": ["user1-uuid"],
"teams": ["team1-uuid"]
}
Response:
{
"id": "new-event-uuid",
"name": "Product Demo Call",
"event_type": "Call",
"status": "Planned",
"start_date": "2023-02-20",
"start_time": "10:00:00",
...event details...
}
"""Get comprehensive event information and perform updates.
def get_event(pk: str) -> dict:
"""
Get detailed event information.
Args:
pk (str): Event UUID
Returns:
dict: Complete event details with related entities
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
GET /api/events/event-uuid/
Response:
{
"event_obj": {
"id": "event-uuid",
"name": "Client Strategy Meeting",
"event_type": "Meeting",
"status": "Planned",
"start_date": "2023-02-15",
"start_time": "14:00:00",
"end_date": "2023-02-15",
"contacts": ["contact1-uuid"],
"created_on": "2023-01-15T10:30:00Z",
"created_by": "user-uuid"
},
"assigned_to": [...assigned users...],
"teams": [...assigned teams...],
"comments": [...event comments...],
"attachments": [...event attachments...],
"users_mention": [...users for @mentions...]
}
"""
def update_event(pk: str, event_data: dict) -> dict:
"""
Update event information.
Args:
pk (str): Event UUID
event_data (dict): Updated event information
Returns:
dict: Updated event details
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
PUT /api/events/event-uuid/
{
"name": "Client Strategy Meeting - Extended",
"start_time": "13:30:00",
"status": "Confirmed"
}
"""
def delete_event(pk: str) -> None:
"""
Delete an event.
Args:
pk (str): Event UUID
Returns:
None: 204 No Content on success
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
DELETE /api/events/event-uuid/
"""Manage comments and file attachments for events.
def add_event_comment_or_attachment(pk: str, comment: str = None,
attachment: file = None) -> dict:
"""
Add comment or attachment to event.
Args:
pk (str): Event 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/events/event-uuid/
{
"comment": "Meeting rescheduled due to client availability"
}
"""
def edit_event_comment(pk: str, comment: str) -> dict:
"""
Edit an event comment.
Args:
pk (str): Comment UUID
comment (str): Updated comment text
Returns:
dict: Updated comment
Headers Required:
Authorization: Bearer <access_token>
Example:
PUT /api/events/comment/comment-uuid/
{
"comment": "Meeting confirmed with all attendees"
}
"""
def delete_event_comment(pk: str) -> None:
"""
Delete an event comment.
Args:
pk (str): Comment UUID
Returns:
None: 204 No Content on success
Headers Required:
Authorization: Bearer <access_token>
Example:
DELETE /api/events/comment/comment-uuid/
"""
def delete_event_attachment(pk: str) -> None:
"""
Delete an event attachment.
Args:
pk (str): Attachment UUID
Returns:
None: 204 No Content on success
Headers Required:
Authorization: Bearer <access_token>
Example:
DELETE /api/events/attachment/attachment-uuid/
"""class Event:
"""Event model representing calendar events and meetings"""
id: str # UUID
name: str # Required event name
event_type: str # 'Call', 'Meeting', 'Task'
status: str # Event status (e.g., 'Planned', 'Confirmed', 'Completed')
# Scheduling information
start_date: date # Event start date
start_time: time # Event start time
end_date: date # Event end date (optional)
# Entity associations
contacts: list[str] # Contact UUIDs for invitations
# 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 EventComment:
"""Comments on events"""
id: str # UUID
comment: str
event: str # Event UUID
commented_on: datetime
commented_by: str # User UUID
class EventAttachment:
"""File attachments on events"""
id: str # UUID
attachment: str # File path/URL
event: str # Event UUID
created_on: datetime
created_by: str # User UUIDEvents support different types for various business activities:
Events support multiple search and filter options:
name parameter for partial text matchingassigned_to filtering by user UUIDAll text-based filters support partial matching and are case-insensitive.
Events can be associated with and relate to:
This makes events central to scheduling and activity coordination across the CRM system.
Install with Tessl CLI
npx tessl i tessl/pypi-django-crm