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
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"
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 wrote:
>
> Hi
>
> One of the simplest ways is to use special serializer. At least django-nap
> and
I was about to that by this
from rest_framework_jwt.serializers import VerifyJSONWebTokenSerializer
data = {'token': token}
valid_data = VerifyJSONWebTokenSerializer().validate(data)
user = valid_data['user']
Hope this helps any body like me.
On Sat, Sep 16, 2017 at 9:34 AM, Robin Lery
I want to make two or three dropdown menus which are dependent on each
other. It's Country, City dropdown menus and when Country is selected City
dropdown menu has to be filled with proper cities. How can I make this?
I have the data, installed the django-cities-light app and filled my db
with
Ok, thanks. So, I was confused about two things on authenticating a user.
1. What to do with the token?
- You can pass the token as a query string and get that query params.
Read more about how to get the query params here
If all dropdowns are on the same page, you probably need to create some views
that return json, then hit those views with ajax.
On September 15, 2017 9:25:42 PM CDT, "Ahmet Muazim Tunç"
wrote:
>I want to make two or three dropdown menus which are dependent on each
Instead of using ManyToMany in stencil, add a ForeignKey(EditorStencil) in
vocab.
On September 13, 2017 6:25:32 PM CDT, Jack Razors wrote:
>I am creating a mindmap visio-like editor website using d3js and a
>bunch of
>custom javascript. Rather than the schema/stencils
I have a small app in which I have form for taking 5 inputs as City1,
City2,City3,City4 and City5 as the fields. I have written a code for auto
completing it but A user can not enter the new fields. Only existing values
can be used. How can I make it to accept a new field if not present in the
9 matches
Mail list logo