Re: [Django] #28012: JsonField PostgreSQL problem

2017-04-03 Thread Django
#28012: JsonField PostgreSQL problem
--+--
 Reporter:  Martín Peveri |Owner:  (none)
 Type:  Uncategorized |   Status:  closed
Component:  contrib.postgres  |  Version:  1.10
 Severity:  Normal|   Resolution:  invalid
 Keywords:| Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--

Comment (by Martín Peveri):

 Ok, perfect. And how can I insert many dictionaries in the field, as I
 have in my data if it is not in a list?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.f51d25906f7ad0847922f8530dd391dc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28012: JsonField PostgreSQL problem

2017-04-03 Thread Django
#28012: JsonField PostgreSQL problem
--+--
 Reporter:  Martín Peveri |Owner:  (none)
 Type:  Uncategorized |   Status:  closed
Component:  contrib.postgres  |  Version:  1.10
 Severity:  Normal|   Resolution:  invalid
 Keywords:| Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--
Changes (by Tim Graham):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 There might be a way to use `QuerySet.annotate()` to add an attribute with
 the result you expect, however, please see
 TicketClosingReasons/UseSupportChannels for places to usage questions like
 this.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.e75a9830d0340c0929d9f6628f9da60d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28012: JsonField PostgreSQL problem

2017-04-03 Thread Django
#28012: JsonField PostgreSQL problem
--+--
 Reporter:  Martín Peveri |Owner:  (none)
 Type:  Uncategorized |   Status:  new
Component:  contrib.postgres  |  Version:  1.10
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--

Comment (by Arun Kumar):

 The above statement has to return 'dict'.

 Replying to [comment:2 Martín Peveri]:
 > Hi, That does not give me back anything.
 >
 > The content type of data is:
 >
 >
 > {{{
 > >>> type(c.itemscampaign.all()[0].data)
 > 
 > }}}
 >
 >
 >
 >
 >
 >

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.5089ca5ca40e52fb5bae547abb83e004%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28012: JsonField PostgreSQL problem

2017-04-03 Thread Django
#28012: JsonField PostgreSQL problem
--+--
 Reporter:  Martín Peveri |Owner:  (none)
 Type:  Uncategorized |   Status:  new
Component:  contrib.postgres  |  Version:  1.10
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--

Comment (by Martín Peveri):

 Hi, That does not give me back anything.

 The content type of data is:

 >>> type(c.itemscampaign.all()[0].data)
 

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.de139ccb88cfc37da65392ea10d4a13f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28012: JsonField PostgreSQL problem

2017-04-03 Thread Django
#28012: JsonField PostgreSQL problem
--+--
 Reporter:  Martín Peveri |Owner:  (none)
 Type:  Uncategorized |   Status:  new
Component:  contrib.postgres  |  Version:  1.10
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--

Comment (by Arun Kumar):

 For json fields you need to do
 {{{
 itemscampaign.filter(data__contains__processed=True)
 }}}

 Your current query is only checking for existing of processed key in data.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.9d89f6fd3dfb2576f444bd9507ea9fc3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #28012: JsonField PostgreSQL problem

2017-04-02 Thread Django
#28012: JsonField PostgreSQL problem
+
   Reporter:  Martín Peveri |  Owner:  (none)
   Type:  Uncategorized | Status:  new
  Component:  contrib.postgres  |Version:  1.10
   Severity:  Normal|   Keywords:
   Triage Stage:  Unreviewed|  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
  UI/UX:  0 |
+
 Hi, I have a model with a field JsonField of PostgreSQL of name 'data',
 like this:

 {{{
 class ItemCampaign(models.Model):

campaign = models.ForeignKey(
Campaign, related_name="itemscampaign", verbose_name="Item campaña"
)
data = JSONField(default=dict)

def __str__(self):
return self.campaign.name
 }}}


 In this field i have one record with this data, for example:

 {{{
 [{'number': '1160188479', 'id': 0, 'content': 'hello', 'processed': True},
 {'number': '1160188479', 'id': 1, 'content': 'hello', 'processed': False},
 {'number': '1160188479', 'id': 2, 'content': 'hello', 'processed': False},
 {'number': '1162341721', 'id': 3, 'content': 'hello', 'processed': False},
 {'number': '1162341721', 'id': 4, 'content': 'hello', 'processed': False},
 {'number': '1162341721', 'id': 5, 'content': 'hello', 'processed': False}]
 }}}

 If i want filtered, like this:

 {{{
 itemscampaign.filter(data__contains=[{'processed': True}])
 }}}

 This code returned all content data field, Instead of just the dict with
 'processed' in True. I want know if this is an error or not is possible.

 Thanks!

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.2d5012ad9f736aa288b71c43cd07fbba%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.