intranet.apps.enrichment package

Submodules

intranet.apps.enrichment.admin module

class intranet.apps.enrichment.admin.EnrichmentActivityAdmin(model, admin_site)[source]

Bases: ModelAdmin

list_display = ('title', 'location', 'time', 'capacity', 'presign', 'attendance_taken')
list_filter = ('time', 'presign', 'attendance_taken')
ordering = ('-time',)
search_fields = ('title', 'description', 'groups_allowed__name', 'groups_blacklisted__name')

intranet.apps.enrichment.forms module

class intranet.apps.enrichment.forms.EnrichmentActivityForm(*args, **kwargs)[source]

Bases: ModelForm

class Meta[source]

Bases: object

fields = ['title', 'description', 'time', 'location', 'capacity', 'presign', 'groups_allowed', 'groups_blacklisted']
model

alias of EnrichmentActivity

declared_fields = {}

intranet.apps.enrichment.models module

class intranet.apps.enrichment.models.EnrichmentActivity(*args, **kwargs)[source]

Bases: Model

An enrichment activity available to the TJ community.

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.

attendance_taken

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

attended

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 and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

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 and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

capacity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_added(*, field=<django.db.models.fields.DateTimeField: added>, is_next=True, **kwargs)
get_previous_by_added(*, field=<django.db.models.fields.DateTimeField: added>, is_next=False, **kwargs)
groups_allowed

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 and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

groups_blacklisted

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 and Topping.pizzas are ManyToManyDescriptor 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 enrichment activity 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 enrichment activity was created after the start of the school year.

property is_too_early_to_signup

Returns whether it is too early to sign up for the activity if it is a presign. This contains the 2 day presign logic.

Returns:

Whether it is too early to sign up for this scheduled activity and when the activity opens for signups.

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.enrichment.models.EnrichmentActivityManager object>
presign

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property restricted
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.

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 a ForwardManyToOneDescriptor instance.

user_can_signup(user)[source]

Return whether a user can sign up for an enrichment activity.

Parameters:

user – The user to check.

Returns:

Whether the user can sign up for the enrichment activity.

user_id
user_is_blacklisted(user)[source]
class intranet.apps.enrichment.models.EnrichmentActivityManager(*args, **kwargs)[source]

Bases: Manager

get_queryset()[source]
visible_to_user(*args)[source]

Get a list of visible enrichment activities for a given user (usually request.user).

TODO: implement this method. Add group restrictions.

class intranet.apps.enrichment.models.EnrichmentActivityQuerySet(model=None, query=None, using=None, hints=None)[source]

Bases: QuerySet

this_year()[source]

Get enrichment activities created during this school year.

Returns:

Enrichment activities created during this school year.

class intranet.apps.enrichment.models.EnrichmentActivity_attended(id, enrichmentactivity, user)

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

enrichmentactivity

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 a ForwardManyToOneDescriptor instance.

enrichmentactivity_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 a ForwardManyToOneDescriptor instance.

user_id
class intranet.apps.enrichment.models.EnrichmentActivity_attending(id, enrichmentactivity, user)

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

enrichmentactivity

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 a ForwardManyToOneDescriptor instance.

enrichmentactivity_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 a ForwardManyToOneDescriptor instance.

user_id
class intranet.apps.enrichment.models.EnrichmentActivity_groups_allowed(id, enrichmentactivity, group)

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

enrichmentactivity

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 a ForwardManyToOneDescriptor instance.

enrichmentactivity_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 a ForwardManyToOneDescriptor 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.enrichment.models.EnrichmentActivity_groups_blacklisted(id, enrichmentactivity, group)

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

enrichmentactivity

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 a ForwardManyToOneDescriptor instance.

enrichmentactivity_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 a ForwardManyToOneDescriptor 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>

intranet.apps.enrichment.urls module

intranet.apps.enrichment.views module

intranet.apps.enrichment.views.date_format(date)[source]
intranet.apps.enrichment.views.decode_date(date)[source]
intranet.apps.enrichment.views.enrichment_context(request, date=None)[source]
intranet.apps.enrichment.views.is_weekday(date)[source]
intranet.apps.enrichment.views.month_data(request)[source]
intranet.apps.enrichment.views.week_data(request, date=None)[source]

Module contents