from rest_framework import serializers

from .models import Vacancy


class VacancySerializer(serializers.HyperlinkedModelSerializer):
    """
    Common vacancy model serializer
    """
    class Meta:
        model = Vacancy
        fields = (
            'id', 'url', 'title', 'description', 'created_on', 'modified_on'
        )
        extra_kwargs = {
            'url': {'view_name': 'vacancies:vacancy-detail', 'read_only': True}
        }

from rest_framework import serializers

from .models import Vacancy


class VacancySerializer(serializers.ModelSerializer):
    """
    Common vacancy model serializer
    """
    class Meta:
        model = Vacancy
        fields = (
            'id', 'url', 'title', 'description', 'created_on', 'modified_on'
        )
        extra_kwargs = {
            'url': {'view_name': 'api:vacancies:vacancy-detail', 'read_only': True}
        }

Fix for correct resolve URL
jobs-010: Fix for correct resolve URL

  from rest_framework import serializers
  
  from .models import Vacancy
  
  
- class VacancySerializer(serializers.HyperlinkedModelSerializer):
+ class VacancySerializer(serializers.ModelSerializer):
      """
      Common vacancy model serializer
      """
      class Meta:
          model = Vacancy
          fields = (
              'id', 'url', 'title', 'description', 'created_on', 'modified_on'
          )
          extra_kwargs = {
-             'url': {'view_name': 'vacancies:vacancy-detail', 'read_only': True}
+             'url': {'view_name': 'api:vacancies:vacancy-detail', 'read_only': True}
          }
  
Fix for correct resolve URL
## Code Before:
from rest_framework import serializers

from .models import Vacancy


class VacancySerializer(serializers.HyperlinkedModelSerializer):
    """
    Common vacancy model serializer
    """
    class Meta:
        model = Vacancy
        fields = (
            'id', 'url', 'title', 'description', 'created_on', 'modified_on'
        )
        extra_kwargs = {
            'url': {'view_name': 'vacancies:vacancy-detail', 'read_only': True}
        }

## Instruction:
Fix for correct resolve URL
## Code After:
from rest_framework import serializers

from .models import Vacancy


class VacancySerializer(serializers.ModelSerializer):
    """
    Common vacancy model serializer
    """
    class Meta:
        model = Vacancy
        fields = (
            'id', 'url', 'title', 'description', 'created_on', 'modified_on'
        )
        extra_kwargs = {
            'url': {'view_name': 'api:vacancies:vacancy-detail', 'read_only': True}
        }
