+_view_content_type_limiter = ContentTypeSubclassLimiter(None)
+
+
+class Node(TreeEntity):
+ view_content_type = models.ForeignKey(ContentType, related_name='node_view_set', limit_choices_to=_view_content_type_limiter)
+ view_object_id = models.PositiveIntegerField()
+ view = generic.GenericForeignKey('view_content_type', 'view_object_id')
+
+ @property
+ def accepts_subpath(self):
+ return self.view.accepts_subpath
+
+ def render_to_response(self, request, path=None, subpath=None, extra_context=None):
+ return self.view.render_to_response(self, request, path, subpath, extra_context)
+
+ class Meta:
+ app_label = 'philo'
+
+
+# the following line enables the selection of a node as the root for a given django.contrib.sites Site object
+models.ForeignKey(Node, related_name='sites', null=True, blank=True).contribute_to_class(Site, 'root_node')
+
+
+class View(Entity):
+ nodes = generic.GenericRelation(Node, content_type_field='view_content_type', object_id_field='view_object_id')
+