def get_Activity(self): # This is not at the top to prevent circular imports. from models.activity import Activity return Activity.all().ancestor(self)