@classmethod<EOL><INDENT>def _from_pb(cls, pb, set_key=True, ent=None, key=None):<DEDENT>
prop_name = cls.class_._name<EOL>class_name = []<EOL>for plist in [pb.property_list(), pb.raw_property_list()]:<EOL><INDENT>for p in plist:<EOL><INDENT>if p.name() == prop_name:<EOL><INDENT>class_name.append(p.value().stringvalue())<EOL><DEDENT><DEDENT><DEDENT>cls = cls._class_map.get(tuple(class_name), cls)<EOL>return super(PolyModel, cls)._from_pb(pb, set_key, ent, key)<EOL>
Override.

        Use the class map to give the entity the correct subclass.