I will check it out, i have just used the third party package jsonpickle. And it was easy to use
Thanks a lot Yingi Kem > On 16 Sep 2017, at 11:31 AM, Jani Tiainen <rede...@gmail.com> wrote: > > Hi > > One of the simplest ways is to use special serializer. At least django-nap > and django-rest-framework do have excellent serializers you can leverage. > > Django itself also has serializer you can use. > https://docs.djangoproject.com/en/1.11/topics/serialization/ > > 16.9.2017 13.26 "yingi keme" <yingik...@gmail.com> kirjoitti: >> Say you have a simple class >> >> class Cart(object): >> def _init_(self, name, age): >> self.name = name >> self.age = age >> >> And then you have an instance of the class >> >> T = Cart('john', 23) >> >> How will you serialize the object instance T using json? >> >> I know json serializes limited data structure. But i think there is a custom >> way to serialize and deserialize Object instances. >> >> Please help. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users+unsubscr...@googlegroups.com. >> To post to this group, send email to django-users@googlegroups.com. >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/67356dad-a1cd-40f0-aaf5-8a32ed481676%40googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAHn91ofw_JPyEuZJ2fG48w6kydPFzbdq5SjYHRWK0TDaSNehZg%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/AF606193-FD96-4571-A49D-66F03A4C3901%40gmail.com. For more options, visit https://groups.google.com/d/optout.