NDB equivalent for db.class_for_kind

·Tech·No AI

During DB to NDB migration on Google App Engine I’ve got stuck on the problem how to replace db.class_for_kind method. After some research I’ve found (where is it in the documentation? ;-)) that I can use ndb.Model._kind_map. This store all NDB models and I can simply get any model by kind as string, example:

ndb.Model._kind_map.get('Users')

Spot something wrong?

Found a typo, a broken link, or something that could be better? I would love to hear from you. Drop me a message and I will fix it.