問題: ユーザー (B) は、特定の基準に基づいて一連のユーザー (A) からの支援を必要としています。この基準は、ユーザー (A) がプロファイルで設定します。
class UsersAProfiles(db.Model):
industries = db.StringListProperty() #technology, etc. (total 20)
agegroups = db.StringListProperty() #teenagers, etc. (total 10)
tags = db.StringListProperty() #cooking, etc.
(while each User A can enter at most 10 tags, but there is no limit on
what tags are used, e.g., sql, gym, etc. (limited by dictionary!)
... #there are many other properties
ユーザー (B) は、個別に保存されている基準を設定します
class UserBRequestForHelp(db.Model):
myindustries = db.StringListProperty() #technology, etc. (<20)
myagegroups = db.StringListProperty() #teenagers, etc. (<10)
mytags = db.StringListProperty() #cooking, etc.
... #there are many other properties
ここで、B を助ける可能性のあるすべてのユーザー A のリストが必要です。そのために、次のクエリを実行してみます。
query = db.GqlQuery("SELECT * FROM UsersAProfiles WHERE
industries IN :1 AND
agegroups IN :2 AND
tags IN :3",
userB_obj.myindustries , userB_obj.myagegroups, userB_obj.mytags)
しかし、次のエラーが表示されます。
Cannot satisfy query -- too many IN/!= values.
私は本当にここで立ち往生しており、この問題を解決する方法がわかりません。そのようなクエリを実行する方法。さらに、そのようなクエリを実行できるように、モデル クラスを別の方法で設計する必要がありますか? もしそうなら、誰か助けてください。
事前にたくさんありがとう!