
from rest_framework.serializers import (
    HyperlinkedModelSerializer, HyperlinkedIdentityField,
)

from trex.models.project import Project, Entry


class ProjectSerializer(HyperlinkedModelSerializer):

    class Meta:
        model = Project
        fields = ("url", "id", "name", "description", "active", "created")


class ProjectDetailSerializer(HyperlinkedModelSerializer):

    entries = HyperlinkedIdentityField(view_name="project-entries-list")

    class Meta:
        model = Project
        fields = ("id", "name", "description", "active", "created", "entries")


class EntryDetailSerializer(HyperlinkedModelSerializer):

    class Meta:
        model = Entry
        fields = ("date", "duration", "description", "state", "user", "created")


from rest_framework.serializers import (
    HyperlinkedModelSerializer, HyperlinkedIdentityField,
)

from trex.models.project import Project, Entry


class ProjectSerializer(HyperlinkedModelSerializer):

    class Meta:
        model = Project
        fields = ("url", "id", "name", "description", "active", "created")


class ProjectDetailSerializer(HyperlinkedModelSerializer):

    entries = HyperlinkedIdentityField(view_name="project-entries-list")

    class Meta:
        model = Project
        fields = ("id", "name", "description", "active", "created", "entries")


class EntryDetailSerializer(HyperlinkedModelSerializer):

    class Meta:
        model = Entry
        fields = ("url", "id", "date", "duration", "description", "state",
                  "user_abbr", "user", "created", "tags")

Add url, id and trags to the EntriesSerializer
Add url, id and trags to the EntriesSerializer

  
  from rest_framework.serializers import (
      HyperlinkedModelSerializer, HyperlinkedIdentityField,
  )
  
  from trex.models.project import Project, Entry
  
  
  class ProjectSerializer(HyperlinkedModelSerializer):
  
      class Meta:
          model = Project
          fields = ("url", "id", "name", "description", "active", "created")
  
  
  class ProjectDetailSerializer(HyperlinkedModelSerializer):
  
      entries = HyperlinkedIdentityField(view_name="project-entries-list")
  
      class Meta:
          model = Project
          fields = ("id", "name", "description", "active", "created", "entries")
  
  
  class EntryDetailSerializer(HyperlinkedModelSerializer):
  
      class Meta:
          model = Entry
-         fields = ("date", "duration", "description", "state", "user", "created")
+         fields = ("url", "id", "date", "duration", "description", "state",
+                   "user_abbr", "user", "created", "tags")
  
Add url, id and trags to the EntriesSerializer
## Code Before:

from rest_framework.serializers import (
    HyperlinkedModelSerializer, HyperlinkedIdentityField,
)

from trex.models.project import Project, Entry


class ProjectSerializer(HyperlinkedModelSerializer):

    class Meta:
        model = Project
        fields = ("url", "id", "name", "description", "active", "created")


class ProjectDetailSerializer(HyperlinkedModelSerializer):

    entries = HyperlinkedIdentityField(view_name="project-entries-list")

    class Meta:
        model = Project
        fields = ("id", "name", "description", "active", "created", "entries")


class EntryDetailSerializer(HyperlinkedModelSerializer):

    class Meta:
        model = Entry
        fields = ("date", "duration", "description", "state", "user", "created")

## Instruction:
Add url, id and trags to the EntriesSerializer
## Code After:

from rest_framework.serializers import (
    HyperlinkedModelSerializer, HyperlinkedIdentityField,
)

from trex.models.project import Project, Entry


class ProjectSerializer(HyperlinkedModelSerializer):

    class Meta:
        model = Project
        fields = ("url", "id", "name", "description", "active", "created")


class ProjectDetailSerializer(HyperlinkedModelSerializer):

    entries = HyperlinkedIdentityField(view_name="project-entries-list")

    class Meta:
        model = Project
        fields = ("id", "name", "description", "active", "created", "entries")


class EntryDetailSerializer(HyperlinkedModelSerializer):

    class Meta:
        model = Entry
        fields = ("url", "id", "date", "duration", "description", "state",
                  "user_abbr", "user", "created", "tags")
