EventManager¶
Qualified name: intranet.apps.events.models.EventManager
- class intranet.apps.events.models.EventManager(*args, **kwargs)[source]¶
Bases:
Manager
Methods
get_queryset
Get a list of events marked as hidden for a given user (usually request.user).
Get a list of visible events for a given user (usually request.user).
Attributes
Get a list of events marked as hidden for a given user (usually request.user).
These are all events visible to the user – they have just decided to hide them.
- Parameters:
user (User) – A User to check for
- Returns:
Events a user has hid.
- visible_to_user(user)[source]¶
Get a list of visible events for a given user (usually request.user).
These visible events will be those that either have no groups assigned to them (and are therefore public) or those in which the user is a member. It also includes all events created by the user.
- Parameters:
user (User) – A User to check for
- Returns:
Events that either have no groups assigned to them (and are therefore public), were created by the user, or are in a group.