B
B
bq9112020-05-20 11:21:09
Django
bq911, 2020-05-20 11:21:09

Why saves the object like this?

There is a fields dictionary that comes by Ajax from the form (fields = request.POST):
{'name': 'test', 'phone': '7 999 888 77 66'}
Then I create an object through create
Account.objects.create(**fields)
And for some reason it is saved like this:

screen
5ec4e83917506931369473.png


What is the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-05-20
@bq911

Because request.POST contains a MultiValueDict instance.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question