entity_event/models.py
def followers_of(self, entities):
        """Define what entities are followers of the entities passed to this
        method.

        This method can be overridden by a class that concretely
        inherits ``Medium``, to define custom semantics for the
        ``only_following`` flag on relevant ``Subscription``
        objects. Overriding this method, and ``followed_by`` will be
        sufficient to define that behavior. This method is not useful
        to call directly, but is used by the methods that filter
        events and targets.

        This implementation attempts to provide a sane default. In
        this implementation, the followers of the entities passed in
        are defined to be the entities themselves, and their
        sub-entities.

        That is, the followers of individual entities are themselves,
        and if the entity has sub-entities, those sub-entities. This
        works as a default implementation, but, for example, an
        alternate medium may wish to define the opposite behavior,
        where an the followers of an individual entity are themselves
        and all of their super-entities.

        Return a queryset of the entities that follow the given
        entities. This needs to be the inverse of ``followed_by``.

        :type entities: Entity or EntityQuerySet
        :param entities: The Entity, or QuerySet of Entities of interest.

        :rtype: EntityQuerySet
        :returns: A QuerySet of all the entities who are followers of
            any of those given.
        """
        if isinstance(entities, Entity):
            entities = Entity.objects.filter(id=entities.id)
        sub_entities = EntityRelationship.objects.filter(
            super_entity__in=entities).values_list('sub_entity')
        followers_of = Entity.objects.filter(
            Q(id__in=entities) | Q(id__in=sub_entities))
        return followers_of
Define what entities are followers of the entities passed to this
        method.

        This method can be overridden by a class that concretely
        inherits ``Medium``, to define custom semantics for the
        ``only_following`` flag on relevant ``Subscription``
        objects. Overriding this method, and ``followed_by`` will be
        sufficient to define that behavior. This method is not useful
        to call directly, but is used by the methods that filter
        events and targets.

        This implementation attempts to provide a sane default. In
        this implementation, the followers of the entities passed in
        are defined to be the entities themselves, and their
        sub-entities.

        That is, the followers of individual entities are themselves,
        and if the entity has sub-entities, those sub-entities. This
        works as a default implementation, but, for example, an
        alternate medium may wish to define the opposite behavior,
        where an the followers of an individual entity are themselves
        and all of their super-entities.

        Return a queryset of the entities that follow the given
        entities. This needs to be the inverse of ``followed_by``.

        :type entities: Entity or EntityQuerySet
        :param entities: The Entity, or QuerySet of Entities of interest.

        :rtype: EntityQuerySet
        :returns: A QuerySet of all the entities who are followers of
            any of those given.
        
Define what entities are followers of the entities passed to this
method.



This implementation attempts to provide a sane default. In
this implementation, the followers of the entities passed in
are defined to be the entities themselves, and their
sub-entities.

That is, the followers of individual entities are themselves,
and if the entity has sub-entities, those sub-entities. This
works as a default implementation, but, for example, an
alternate medium may wish to define the opposite behavior,
where an the followers of an individual entity are themselves
and all of their super-entities.

Return a queryset of the entities that follow the given
entities. This needs to be the inverse of ``followed_by``.
Define what entities are followers of the entities passed to this method . This implementation attempts to provide a sane default . In this implementation the followers of the entities passed in are defined to be the entities themselves and their sub - entities . That is the followers of individual entities are themselves and if the entity has sub - entities those sub - entities . This works as a default implementation but for example an alternate medium may wish to define the opposite behavior where an the followers of an individual entity are themselves and all of their super - entities . Return a queryset of the entities that follow the given entities . This needs to be the inverse of ` ` followed_by ` ` .
def followers_of(self, entities):
        if isinstance(entities, Entity):
            entities = Entity.objects.filter(id=entities.id)
        sub_entities = EntityRelationship.objects.filter(
            super_entity__in=entities).values_list('sub_entity')
        followers_of = Entity.objects.filter(
            Q(id__in=entities) | Q(id__in=sub_entities))
        return followers_of
def followers_of ( self , entities ) : if isinstance ( entities , Entity ) : entities = Entity . objects . filter ( id = entities . id ) sub_entities = EntityRelationship . objects . filter ( super_entity__in = entities ) . values_list ( 'sub_entity' ) followers_of = Entity . objects . filter ( Q ( id__in = entities ) | Q ( id__in = sub_entities ) ) return followers_of
Define what entities are followers of the entities passed to this
method.
Define what entities are followers of the entities passed to this method .
"""Define what entities are followers of the entities passed to this
        method.

        This method can be overridden by a class that concretely
        inherits ``Medium``, to define custom semantics for the
        ``only_following`` flag on relevant ``Subscription``
        objects. Overriding this method, and ``followed_by`` will be
        sufficient to define that behavior. This method is not useful
        to call directly, but is used by the methods that filter
        events and targets.

        This implementation attempts to provide a sane default. In
        this implementation, the followers of the entities passed in
        are defined to be the entities themselves, and their
        sub-entities.

        That is, the followers of individual entities are themselves,
        and if the entity has sub-entities, those sub-entities. This
        works as a default implementation, but, for example, an
        alternate medium may wish to define the opposite behavior,
        where an the followers of an individual entity are themselves
        and all of their super-entities.

        Return a queryset of the entities that follow the given
        entities. This needs to be the inverse of ``followed_by``.

        :type entities: Entity or EntityQuerySet
        :param entities: The Entity, or QuerySet of Entities of interest.

        :rtype: EntityQuerySet
        :returns: A QuerySet of all the entities who are followers of
            any of those given.
        """
A QuerySet of all the entities who are followers of
any of those given.
A QuerySet of all the entities who are followers of any of those given .
EntityQuerySet
self
entities
The Entity, or QuerySet of Entities of interest.
The Entity or QuerySet of Entities of interest .