[Answered ]-Simple Django Search Run on Django App Engine?

0đź‘Ť

âś…

Ok, so after fiddling around with different kinds of queries using “python manage.py remote shell”, I’ve come to the following conclusions:

1) As @dragonx mentioned, Q objects with “OR” are not supported.

2) However, Q objects with “&” definitely are.

3) The problem with my search view code, other than the “OR” queries, was the addition of “distinct()” in my “Player.objects.filter()” call. Apparently the HRD doesn’t support “distinct()”, and this was responsible for the cryptic

“DatabaseError: This query is not supported by the database”

message. By contrast, attempting to use a Q object with “OR” gives a much more helpful

“DatabaseError: Only AND filters are supported”

Now that I’ve removed the “distinct()” bit from my code (and any “OR”-containing Q objects), the search works fine.

👤GChorn

2đź‘Ť

Generally, JOINs are not supported, so all the Q objects with ORs probably won’t work.

I haven’t used dbindexer much, so I’m not sure how capable it is. I do think if you use it, it will make your datastore queries expensive with all the extra indexing it tries to do automatically.

Even if you’re using django-nonrel, you can’t expect to port a django app over directly if it uses relational data. You’ll have to restructure your data and queries to be non-relational.

👤dragonx

Leave a comment