intranet.apps.events package¶
Subpackages¶
Submodules¶
intranet.apps.events.admin module¶
intranet.apps.events.forms module¶
- class intranet.apps.events.forms.AdminEventForm(*args, all_groups=False, **kwargs)[source]¶
Bases:
ModelForm
- class Meta[source]¶
Bases:
object
- fields = ['title', 'description', 'time', 'location', 'scheduled_activity', 'announcement', 'groups', 'show_attending', 'show_on_dashboard', 'public', 'category', 'open_to']¶
- help_texts = {'announcement': 'OPTIONAL: Enter the ID of the announcement -- it will be displayed above the event.', 'scheduled_activity': 'OPTIONAL: Enter the ID of the scheduled activity -- it will be displayed above the event.'}¶
- widgets = {'announcement': <django.forms.widgets.NumberInput object>, 'scheduled_activity': <django.forms.widgets.NumberInput object>}¶
- declared_fields = {}¶
intranet.apps.events.models module¶
- class intranet.apps.events.models.Event(*args, **kwargs)[source]¶
Bases:
Model
An event available to the TJ community.
- links¶
Links to be attached to the event. Not currently used.
- Type:
LinksQuerySet
- added¶
Time created (automatically set).
- Type:
- updated¶
Time last modified (automatically set).
- Type:
- time¶
The date and time of the event.
- Type:
- scheduled_activity¶
An EighthScheduledActivity that should be linked with the event.
- Type:
- announcement¶
An Announcement that should be linked with the event.
- Type:
- groups¶
Groups that the event is visible to.
- Type:
GroupQuerySet
- attending¶
Users that are attending the event.
- Type:
UserQuerySet
- rejected¶
Whether the event was rejected and shouldn’t be shown in the list of events that need to be approved.
- Type:
- open_to¶
Whether this event is open to parents, students, or both, shown on the login page.
- Type:
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- added¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- announcement¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- announcement_id¶
- approved¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- approved_by¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- approved_by_id¶
- attending¶
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- category¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property dashboard_type¶
Return what type of object it is
- description¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_category_display(*, field=<django.db.models.fields.CharField: category>)¶
- get_next_by_added(*, field=<django.db.models.fields.DateTimeField: added>, is_next=True, **kwargs)¶
- get_next_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=True, **kwargs)¶
- get_open_to_display(*, field=<django.db.models.fields.CharField: open_to>)¶
- get_previous_by_added(*, field=<django.db.models.fields.DateTimeField: added>, is_next=False, **kwargs)¶
- get_previous_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=False, **kwargs)¶
- groups¶
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- property happened¶
Return whether an event has happened.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property is_this_year¶
Return whether the event was created after the start of the school year.
- links¶
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- location¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <intranet.apps.events.models.EventManager object>¶
- open_to¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property pinned¶
implement event pinning
- Type:
TODO
- public¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- rejected¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- rejected_by¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- rejected_by_id¶
- scheduled_activity¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- scheduled_activity_id¶
- show_attending¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- show_fuzzy_date()[source]¶
Checks whether the event is in the next or previous 2 weeks.
- Returns:
Whether to display the fuzzy date.
- show_on_dashboard¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- time¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- title¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- updated¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- user¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- user_id¶
- property user_map¶
Return or create an EventUserMap
- class intranet.apps.events.models.EventManager(*args, **kwargs)[source]¶
Bases:
Manager
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.
- class intranet.apps.events.models.EventQuerySet(model=None, query=None, using=None, hints=None)[source]¶
Bases:
QuerySet
- class intranet.apps.events.models.EventUserMap(*args, **kwargs)[source]¶
Bases:
Model
Represents a mapping between events and users.
These attributes would be a part of the Event model, but if they are, the last updated date is changed whenever a student sees or hides an event.
Access these through event.user_map
If you are checking to see whether a user has hidden an event, use: >>> Event.objects.hidden_events(user)
A many-to-many field of Users who have hidden this event
- Type:
UserQuerySet
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- event¶
Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
- event_id¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- users_hidden¶
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
Bases:
Model
Bases:
ObjectDoesNotExist
Bases:
MultipleObjectsReturned
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- class intranet.apps.events.models.Event_attending(id, event, user)¶
Bases:
Model
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- event¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- event_id¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- user¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- user_id¶
- class intranet.apps.events.models.Event_groups(id, event, group)¶
Bases:
Model
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- event¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- event_id¶
- group¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- group_id¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- class intranet.apps.events.models.Event_links(id, event, link)¶
Bases:
Model
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- event¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- event_id¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- link¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- link_id¶
- objects = <django.db.models.manager.Manager object>¶
- class intranet.apps.events.models.Link(*args, **kwargs)[source]¶
Bases:
Model
A link about an item (Facebook event link, etc).
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- event_set¶
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- title¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- url¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class intranet.apps.events.models.TJStarUUIDMap(*args, **kwargs)[source]¶
Bases:
Model
A mapping between a user and UUID for the tjSTAR widget.
- user¶
The associated user.
- uuid¶
The tjSTAR UUUID
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- user¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- user_id¶
- uuid¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
intranet.apps.events.notifications module¶
intranet.apps.events.tasks module¶
intranet.apps.events.tests module¶
- class intranet.apps.events.tests.EventsTest(methodName='runTest')[source]¶
Bases:
IonTestCase
Tests for the events module.