feat(src/notes): add note CRUD API

Implement models, serializers, views and URLs for managing project notes; enables structured association of notes with projects and users, improving organization and auditability.
This commit is contained in:
sankalp committed 2026-06-25 23:07:58 +05:45
1 parent 72a4c81028
commit 0851411be7
5 files changed
+86 -16

No files matched your search

+26 -3
View File
@@ -1,5 +1,28 @@
"""generated with djinit"""
from django.conf import settings
from django.db import models
# Create your models here.
class ProjectNote(models.Model):
project = models.ForeignKey(
"projects.Project", on_delete=models.CASCADE, related_name="notes"
)
created_by = models.ForeignKey(
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name="project_notes"
)
title = models.CharField(max_length=255)
content = models.TextField(blank=True, null=True)
note_date = models.DateField()
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
db_table = "project_notes"
verbose_name = "Project Note"
verbose_name_plural = "Project Notes"
indexes = [
models.Index(fields=["project", "note_date"]),
]
def __str__(self):
return f"{self.title} - {self.project.name}"