Google App Engine 用に Danny Hermes によって作成された Endpoints-proto-datastore を使用しており、エンティティを更新する方法を理解するのに助けが必要です。更新する必要があるもののモデルは次のとおりです。
class Topic(EndpointsModel):
#_message_fields_schema = ('id','topic_name','topic_author')
topic_name = ndb.StringProperty(required=True)
topic_date = ndb.DateTimeProperty(auto_now_add=True)
topic_author = ndb.KeyProperty(required=True)
topic_num_views = ndb.IntegerProperty(default=0)
topic_num_replies = ndb.IntegerProperty(default=0)
topic_flagged = ndb.BooleanProperty(default=False)
topic_followers = ndb.KeyProperty(repeated=True)
topic_avg_rating = ndb.FloatProperty(default=0.0)
topic_total_rating = ndb.FloatProperty(default=0.0)
topic_num_ratings = ndb.IntegerProperty(default=0)
topic_raters = ndb.KeyProperty(repeated=True)
ご覧のとおり、評価プロパティの既定値は 0 です。そのため、トピックが評価されるたびに、各評価プロパティを更新する必要があります。ただし、私のプロパティはどれも、ユーザーによって提供された実際の評価ではありません. ユーザーがトピックを評価した値を渡して、モデルのプロパティを更新できるようにするにはどうすればよいですか? ありがとう!