Monday, March 27, 2017

Re: Update dict JsonField Postgresql

Hi  Melvyn, With "not working", I mean that it does nothing. For example

This line

>>> objectitem.data[0]['processed'] True

It does not return any errors

This line:

>>> objectitem.save()

Neither

So when I'm going to get the record back, it returns me the same.

>>> objectitem.data[0]
>>> False

I would have to return True. I explain? My English is not very good.

You can explain a little more this: "Django's JSONEncoder only accepts dicts as outermost structure."

I am inserting a list of dicts. For example:

>>> Model.objects.create(data={[......my dicts ]}

That's wrong?

Thanks!


El lunes, 27 de marzo de 2017, 11:52:37 (UTC-2), Melvyn Sopacua escribió:

On Monday 27 March 2017 05:56:34 Martin Peveri wrote:

 

> But not working.

>

> Any Idea?.

 

Plenty. But start by defining "not working". Not trying to be snarky, but there are a lot of moving parts here and it's anybody's guess at this point what part is causing the problem. We don't even know how you determined it's not working (get an exception, value isn't changed, save doesn't get called, form errors ... ).

 

Here's my shot in the dark:

Django's JSONEncoder only accepts dicts as outermost structure.

--

Melvyn Sopacua

--
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+unsubscribe@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/566e1231-b643-49f7-88e1-0abef9991c71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment