feat(src/epics): scaffold epic module with models, admin, serializers, urls, views
Implement core Epic model and API for managing project epics, enabling CRUD operations and integration with admin and DRF.
This commit is contained in:
5 files changed
+83
-16
No files matched your search
@@ -1,5 +1,27 @@
|
||||
"""generated with djinit"""
|
||||
|
||||
from rest_framework import serializers
|
||||
|
||||
# Create your serializers here.
|
||||
from src.epics.models import Epic
|
||||
|
||||
|
||||
class EpicSerializer(serializers.ModelSerializer):
|
||||
ticket_count = serializers.SerializerMethodField()
|
||||
|
||||
class Meta:
|
||||
model = Epic
|
||||
fields = (
|
||||
"id",
|
||||
"project",
|
||||
"name",
|
||||
"description",
|
||||
"start_date",
|
||||
"end_date",
|
||||
"sort_order",
|
||||
"ticket_count",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
)
|
||||
read_only_fields = ("id", "created_at", "updated_at")
|
||||
|
||||
def get_ticket_count(self, obj):
|
||||
return obj.tickets.count()
|
||||
|
||||
Reference in new issue
Block a user