Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#project serializers
from .models import Team, Project

from .models import Task,Note,Group,Objectives

User=get_user_model()

Expand All @@ -17,9 +17,6 @@ class Meta:
model = User
fields = ['username','email']




class MyTokenObtainPairSerializer(TokenObtainPairSerializer):
@classmethod
def get_token(cls, user):
Expand Down Expand Up @@ -86,3 +83,38 @@ class Meta:
#the list of task and note IDs instead of nested serializers
tasks = serializers.PrimaryKeyRelatedField(many=True, read_only=True)
notes = serializers.PrimaryKeyRelatedField(many=True, read_only=True)


class GroupSerializer(serializers.ModelSerializer):
class Meta:
model=Group
fields=['name','project']

class TaskSerializer(serializers.ModelSerializer):
projects=ProjectSerializer(many=True,read_only=True)
groups=GroupSerializer(many=True,read_only=True)
#objectives=ObjectivesSerializer(many=True,source='objectivesserializers',read_only=True)
class Meta:
model=Task
fields=['name','project','group','description']
read_only_fields=['created_at']

class ObjectivesSerializer(serializers.ModelSerializer):
tasks=TaskSerializer(many=True,read_only=True)
class Meta:
model=Objectives
fields=['name','completed','task']
read_only_fields=['created_at']

class NoteSerializer(serializers.ModelSerializer):
projects=ProjectSerializer(many=True,read_only=True)
group=GroupSerializer(many=True,read_only=True)
class Meta:
model=Note
fields=['name','project','group','description']
read_only_fields=['created_at']





17 changes: 0 additions & 17 deletions template.env
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you delete this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the second step of setting up the development environment too literally.
I created a .env file, copied the contents of template.env to it, and then deleted template.env.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I will be putting this PR on hold for now.

This file was deleted.