I have this (working) model:
class WorkingModel(ndb.Model):
# ...some properties...
def _pre_put_hook(self):
self.key = ndb.Key(WorkingModel, slugify(self.name))
What if I want to generalize the solution via inheritance? i.e.:
class slugModel(ndb.Model):
def _pre_put_hook(self):
self.key = ndb.Key(???, slugify(self.name))
class WorkingModel(slugModel):
name = ndb.StringProperty()
You can use self.__class__
as argument.