Revival here for future readers:
I circumvented this use case by specifying a private attribute that represents the relationship within the classes and property to check if the object can be retrieved from the database or is in memory.
Here is a simple example:
class Parent(models.Model): _children = [] name = models.CharField(max_length=100) @property def children(self): if _children: return self._children else: return self.children_set.all() def set_virtual_children(self, value):
That way I can install "virtual children" and use all the specific methods on the fly
source share