from django.urls import reverse
from rest_framework import serializers
from todo.models import Todo

class TodoSerializer(serializers.ModelSerializer):
    url = serializers.SerializerMethodField()

    class Meta:
        model = Todo
        fields = ('id', 'url', 'titulo', 'descricao', 'concluido')
    
    def url(self, obj):
        return reverse('todo-detail', args=[obj.id])
9952a3ff12d717e177263915ffdef7cfb9b97d83
<mask token>


class TodoSerializer(serializers.ModelSerializer):
    <mask token>


    class Meta:
        model = Todo
        fields = 'id', 'url', 'titulo', 'descricao', 'concluido'
    <mask token>

<mask token>


class TodoSerializer(serializers.ModelSerializer):
    <mask token>


    class Meta:
        model = Todo
        fields = 'id', 'url', 'titulo', 'descricao', 'concluido'

    def url(self, obj):
        return reverse('todo-detail', args=[obj.id])

<mask token>


class TodoSerializer(serializers.ModelSerializer):
    url = serializers.SerializerMethodField()


    class Meta:
        model = Todo
        fields = 'id', 'url', 'titulo', 'descricao', 'concluido'

    def url(self, obj):
        return reverse('todo-detail', args=[obj.id])

from django.urls import reverse
from rest_framework import serializers
from todo.models import Todo


class TodoSerializer(serializers.ModelSerializer):
    url = serializers.SerializerMethodField()


    class Meta:
        model = Todo
        fields = 'id', 'url', 'titulo', 'descricao', 'concluido'

    def url(self, obj):
        return reverse('todo-detail', args=[obj.id])

from django.urls import reverse
from rest_framework import serializers
from todo.models import Todo

class TodoSerializer(serializers.ModelSerializer):
    url = serializers.SerializerMethodField()

    class Meta:
        model = Todo
        fields = ('id', 'url', 'titulo', 'descricao', 'concluido')
    
    def url(self, obj):
        return reverse('todo-detail', args=[obj.id])