Hi.
I can see the difference between what you have and what you want.
El jueves, 29 de septiembre de 2016, 12:32:36 (UTC+2), 高金 escribió:
>
> *My data is*
> {
> "id": 1,
> "title": "",
> "href": "https://www.douban.com/",
> "abstract": "{'a':1,'b':2}",
> "img": "",
> "favs": 0
> }
>
> *I want to*
>
> {
> "id": 1,
> "title": "",
> "href": "https://www.douban.com/",
> "abstract": {'a':1,'b':2},
> "img": "",
> "favs": 0
> }
> *What should I do?*
>
> *I am a rookie...*
>
> *models.py*
>
> from django.db import models
>
> class doulist(models.Model):
>
> title = models.CharField(max_length=200,blank=True)
> href = models.CharField(max_length=200,unique=True)
> abstract = models.TextField(blank=True)
> img = models.CharField(max_length=150,blank=True)
> favs = models.IntegerField(default=0)
> update = models.DateField(auto_now=True)
> types = models.CharField(max_length=20)
>
>
> serializers.py
>
>
> from rest_framework import serializers
> from .models import doulist
> class SnippetSerializer(serializers.ModelSerializer):
> class Meta:
> model = doulist
> fields = ('id','title', 'href', 'abstract', 'img', 'favs')
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.