Open DavidMuller opened 10 years ago
Hi,
good point.
I changed the title of the issue and forward this to the mailing list. https://groups.google.com/forum/#!forum/django-hstore
Thanks for doing that Federico!
A little more succinctly what I'd like to do is: do a filter operation on the value of a specific key.
The following query is incorrect syntactically, but conveys the type of query I'd like to make: SomeHstoreModel.objects.filter(hstore_attribute['specific_key']__contains="string I am looking for")
I'll add the above to the mailing list thread.
Sorry for the delay in the answer, we had many issue to resolve. At the moment this is not possible so I marked this as a feature request.
Hello, I'm having trouble forming a django ORM query for a query. In plain english, the query sounds like: "select a row where data[my_key] contains the string I'm looking for."
Concretely, consider the following model:
The following model instance:
I'd like to make use the Django ORM that makes a query equivalent to the following SQL:
I can't seem to find a way to do that within the ORM.
TestHstore.objects.filter(data__contains={'en_us': "english"})
works for exact matches of the value in the key/value pair, but fails to return a database row when the value doesn't match completely (TestHstore.objects.filter(data__contains={'en_us': "eng"})
)Any Suggestions?
Thanks for this cool package--really great work!