Во-первых, я относительно новичок в Google App Engine, поэтому я, вероятно, делаю что-то глупое.
Скажем, у меня есть модель Foo:
class Foo(db.Model):
name = db.StringProperty()
Я хочу использовать name
как уникальный ключ для каждого объекта Foo
. Как это делается?
Когда я хочу получить конкретный объект Foo
, я в настоящее время запрашиваю хранилище данных для всех объектов Foo
с целевым уникальным именем, но запросы медленны (плюс это боль, чтобы гарантировать, что name
является уникальным, когда каждый новый Foo
создается).
Там должен быть лучший способ сделать это!
Спасибо.