query comparisons on multiple keys of an HStore field

43 views
Skip to first unread message

Marcela Campo

unread,
Jul 4, 2014, 2:28:01 PM7/4/14
to django...@googlegroups.com
Hi,
  I am trying to filter by multiple keys on an HStore field using gte and/or lte, for example

Just one other question, I am trying to filter by multiple keys in the HStore field, so I would like to do something like

Something.objects.filter(data__gte={'a': '1','b':'5'})

That yields an Invalid Value exception. Looking at the code only one key/value pair can be passed inside the dictionary for gt/gt/lte/lt. 
Is there a way to do this? Or is it just not contemplated? 

Thanks!
Marcela

Nemesis

unread,
Jul 7, 2014, 1:23:37 PM7/7/14
to django...@googlegroups.com
Hi Marcela,
This is not documented as an available feature, although it is not stated explicitly that it is not possible.

If you think it's worth to have this feature you could try to write a test for it and then implement it.

Federico

Marcela Campo

unread,
Jul 7, 2014, 1:30:19 PM7/7/14
to django...@googlegroups.com
Hi Federico,
  I modified the code quickly a couple of days ago and have it working locally. However, most probably I haven't implemented it the cleanest way. I'll try to make myself some time to dig deeper and propose a patch. I am a bit new to python so it will take me some time, but I'll give it a try.

Thanks
Marcela


--
You received this message because you are subscribed to a topic in the Google Groups "django-hstore" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-hstore/FTGYnGXGeG8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-hstor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nemesis

unread,
Jul 7, 2014, 1:31:30 PM7/7/14
to django...@googlegroups.com
Don't you worry, release often release early, send the pull request so we can take a look at it and give you hints on how to improve the code.
You received this message because you are subscribed to the Google Groups "django-hstore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-hstor...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages