entity_event/models.py
def followed_by(self, entities):
        """Define what entities are followed by 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 ``followers_of`` 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 entities followed by the ``entities``
        argument are the entities themselves, and their super entities.

        That is, individual entities follow themselves, and the groups
        they are a part of. This works as a default implementation,
        but, for example, an alternate medium may wish to define the
        opposite behavior, where an individual entity follows
        themselves and all of their sub-entities.

        Return a queryset of the entities that the given entities are
        following. This needs to be the inverse of ``followers_of``.

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

        :rtype: EntityQuerySet
        :returns: A QuerySet of all the entities followed by any of
            those given.
        """
        if isinstance(entities, Entity):
            entities = Entity.objects.filter(id=entities.id)
        super_entities = EntityRelationship.objects.filter(
            sub_entity__in=entities).values_list('super_entity')
        followed_by = Entity.objects.filter(
            Q(id__in=entities) | Q(id__in=super_entities))
        return followed_by
Define what entities are followed by 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 ``followers_of`` 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 entities followed by the ``entities``
        argument are the entities themselves, and their super entities.

        That is, individual entities follow themselves, and the groups
        they are a part of. This works as a default implementation,
        but, for example, an alternate medium may wish to define the
        opposite behavior, where an individual entity follows
        themselves and all of their sub-entities.

        Return a queryset of the entities that the given entities are
        following. This needs to be the inverse of ``followers_of``.

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

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



This implementation attempts to provide a sane default. In
this implementation, the entities followed by the ``entities``
argument are the entities themselves, and their super entities.

That is, individual entities follow themselves, and the groups
they are a part of. This works as a default implementation,
but, for example, an alternate medium may wish to define the
opposite behavior, where an individual entity follows
themselves and all of their sub-entities.

Return a queryset of the entities that the given entities are
following. This needs to be the inverse of ``followers_of``.
Define what entities are followed by the entities passed to this method . This implementation attempts to provide a sane default . In this implementation the entities followed by the ` ` entities ` ` argument are the entities themselves and their super entities . That is individual entities follow themselves and the groups they are a part of . This works as a default implementation but for example an alternate medium may wish to define the opposite behavior where an individual entity follows themselves and all of their sub - entities . Return a queryset of the entities that the given entities are following . This needs to be the inverse of ` ` followers_of ` ` .
def followed_by(self, entities):
        if isinstance(entities, Entity):
            entities = Entity.objects.filter(id=entities.id)
        super_entities = EntityRelationship.objects.filter(
            sub_entity__in=entities).values_list('super_entity')
        followed_by = Entity.objects.filter(
            Q(id__in=entities) | Q(id__in=super_entities))
        return followed_by
def followed_by ( self , entities ) : if isinstance ( entities , Entity ) : entities = Entity . objects . filter ( id = entities . id ) super_entities = EntityRelationship . objects . filter ( sub_entity__in = entities ) . values_list ( 'super_entity' ) followed_by = Entity . objects . filter ( Q ( id__in = entities ) | Q ( id__in = super_entities ) ) return followed_by
Define what entities are followed by the entities passed to this
method.
Define what entities are followed by the entities passed to this method .
"""Define what entities are followed by 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 ``followers_of`` 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 entities followed by the ``entities``
        argument are the entities themselves, and their super entities.

        That is, individual entities follow themselves, and the groups
        they are a part of. This works as a default implementation,
        but, for example, an alternate medium may wish to define the
        opposite behavior, where an individual entity follows
        themselves and all of their sub-entities.

        Return a queryset of the entities that the given entities are
        following. This needs to be the inverse of ``followers_of``.

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

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