+class NodeManager(CachedManager):\r
+ use_for_related_fields = True\r
+\r
+ def get_query_set(self):\r
+ qs = super(NodeManager, self).get_query_set()\r
+\r
+ if self.model is not Node:\r
+ return qs.filter(node_type=self.model.get_type())\r
+ else:\r
+ return qs\r
+\r
+ def get(self, *args, **kwargs):\r
+ node = super(NodeManager, self).get(*args, **kwargs)\r
+ cls = NodeMetaClass.types.get(node.node_type, None)\r