intranet.apps.schedule package

Subpackages

Submodules

intranet.apps.schedule.admin module

intranet.apps.schedule.api module

class intranet.apps.schedule.api.DayDetail(**kwargs)[source]

Bases: RetrieveAPIView

get_object()[source]
lookup_field = 'date'
permission_classes = (<class 'rest_framework.permissions.AllowAny'>,)
queryset
serializer_class

alias of DaySerializer

class intranet.apps.schedule.api.DayList(**kwargs)[source]

Bases: ListAPIView

get_queryset()[source]
pagination_class

alias of OnePagePagination

permission_classes = (<class 'rest_framework.permissions.AllowAny'>,)
serializer_class

alias of DaySerializer

class intranet.apps.schedule.api.OnePagePagination[source]

Bases: PageNumberPagination

max_page_size = 7
page_size = 1
page_size_query_param = 'page_size'

intranet.apps.schedule.forms module

class intranet.apps.schedule.forms.DayForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: ModelForm

class Meta[source]

Bases: object

fields = ['date', 'day_type']
model

alias of Day

declared_fields = {}
class intranet.apps.schedule.forms.DayTypeForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: ModelForm

class Meta[source]

Bases: object

fields = ['name', 'special', 'codenames', 'blocks']
model

alias of DayType

declared_fields = {}

intranet.apps.schedule.models module

class intranet.apps.schedule.models.Block(id, name, start, end, order)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

daytype_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 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.

end

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.

end_id
id

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

name

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>
order

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

start

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.

start_id
class intranet.apps.schedule.models.CodeName(id, name)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

daytype_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 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.

id

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

name

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.schedule.models.Day(id, date, day_type, comment)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

comment

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

date

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

day_type

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.

day_type_id
property end_time

Return time the school day ends

get_next_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)
get_previous_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)
id

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.schedule.models.DayManager object>
property start_time

Return time the school day begins

class intranet.apps.schedule.models.DayManager(*args, **kwargs)[source]

Bases: Manager

get_future_days()[source]

Return only future Day objects.

today()[source]

Return the Day for the current day

class intranet.apps.schedule.models.DayType(id, name, special)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

blocks

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 class_name
codenames

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.

day_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

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

property end_time: Time

Returns Time the school day ends. Returns None if there are no blocks.

Returns:

The Time at which the school day ends, or None if there are no blocks.

id

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

name

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

property no_school: bool

Returns True if no blocks are scheduled.

Returns:

Whether there are no blocks scheduled.

objects = <django.db.models.manager.Manager object>
special

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

property start_time: Time

Returns Time the school day begins. Returns None if there are no blocks.

Returns:

The Time at which the school day starts, or None if there are no blocks.

class intranet.apps.schedule.models.DayType_blocks(id, daytype, block)

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

block

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.

block_id
daytype

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.

daytype_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.schedule.models.DayType_codenames(id, daytype, codename)

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

codename

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.

codename_id
daytype

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.

daytype_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.schedule.models.Time(id, hour, minute)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

blockend

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

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

blockstart

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

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

date_obj(date)[source]
hour

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

id

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

minute

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>
str_12_hr()[source]

intranet.apps.schedule.notifications module

intranet.apps.schedule.notifications.at_period_point(blocks)[source]
intranet.apps.schedule.notifications.chrome_getdata_check(request)[source]
intranet.apps.schedule.notifications.period_start_end_data(request)[source]

intranet.apps.schedule.serializers module

class intranet.apps.schedule.serializers.BlockSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

fields = ('order', 'name', 'start', 'end')
model

alias of Block

class intranet.apps.schedule.serializers.DaySerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('url', 'date', 'day_type')
model

alias of Day

class intranet.apps.schedule.serializers.DayTypeSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

fields = ('name', 'special', 'blocks')
model

alias of DayType

class intranet.apps.schedule.serializers.TimeSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

fields = ('hour', 'minute')
model

alias of Time

intranet.apps.schedule.tests module

class intranet.apps.schedule.tests.ApiTest(methodName='runTest')[source]

Bases: IonTestCase

Tests the API views related to the schedules app

test_day_detail()[source]
test_day_list()[source]
class intranet.apps.schedule.tests.ScheduleTest(methodName='runTest')[source]

Bases: IonTestCase

Tests schedules.

test_admin_add_view()[source]
test_admin_comment_view()[source]
test_admin_daytype_view()[source]
test_admin_home_view()[source]
test_calendar_view()[source]
test_day()[source]
test_delete_cache()[source]
test_do_default_fill()[source]
test_month_data()[source]
test_schedule_context()[source]
test_schedule_embed()[source]
test_schedule_view()[source]
test_schedule_widget_view()[source]
test_week_data()[source]

intranet.apps.schedule.urls module

intranet.apps.schedule.views module

intranet.apps.schedule.views.calendar_view(request)[source]
intranet.apps.schedule.views.date_format(date)[source]
intranet.apps.schedule.views.decode_date(date)[source]
intranet.apps.schedule.views.delete_cache()[source]
intranet.apps.schedule.views.get_day_data(firstday, daynum)[source]
intranet.apps.schedule.views.is_weekday(date)[source]
intranet.apps.schedule.views.month_data(request)[source]
intranet.apps.schedule.views.schedule_context(request=None, date=None, use_cache=True, show_tomorrow=True)[source]
intranet.apps.schedule.views.schedule_embed(request)[source]
intranet.apps.schedule.views.schedule_view(request)[source]
intranet.apps.schedule.views.schedule_widget_view(request)[source]
intranet.apps.schedule.views.week_data(request, date=None)[source]

Module contents