i tried this, but get a error similar.

TypeError: [{'publish_time': datetime.datetime(2009, 3, 24, 16, 16,
18), 'is_deleted': 0, 'is_confirmed'
: 0, 'title': u'1', 'content': u'111', 'id': 1L}, {'publish_time':
datetime.datetime(2009, 3, 24, 16
, 27, 50), 'is_deleted': 0, 'is_confirmed': 0, 'title': u'12',
'content': u'22', 'id': 2L}, {'publish_time'
: datetime.datetime(2009, 3, 24, 16, 28, 50), 'is_deleted': 0,
'is_confirmed': 0, 'title': u'ssssssss'
, 'content': u'dddddddddddddddd', 'id': 3L}] is not JSON serializable


On Mar 16, 6:44 am, Mateusz Wawrzyniak <wawrzyniak.mate...@gmail.com>
wrote:
> On Mar 14, 10:14 pm, MartinBorthiry <martin.borth...@gmail.com> wrote:
>
> > Hello:
>
> >  I'm Trying to serialize a dict which have a list of Model's instance.
> > The format that i need is json. Something  like that:
>
> >     people = Person.objects.all()
>
> Why don't you use Person.objects.values()?
> You will get a list of dicts so there won't be any problems with
> serialization.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to