I am confused by get_or_insert(..). What should I pass as the key_name? Consider the following example:
class Person(db.model)
name = db.StringProperty(required=True)
Assume that no two people can have the same name. Say I want to get or insert a new Person with name Peter, what would my get_or_insert statement look like?
Cheers,
Pete
The possibly confusing thing here is that the key doesn’t show up directly in your model declaration, so that
name = db.StringPropertybit in your example isn’t needed.get_or_inserttakes the keyname as its first (required) argument, so you’re looking for code like: