class NamedModel(db.Model):
    """A Model subclass for entities which automatically generate their own key
    names on creation. See documentation for _generate_key function for
    requirements."""

def __init__(self, *args, **kwargs):
    kwargs['key_name'] = _generate_key(self, kwargs)
super(NamedModel, self).__init__(*args, **kwargs)

def _generate_key(entity, kwargs):
    pass
Пользовательские ключи для моделей Google App Engine (Python)