EighthBlockManager

Qualified name: intranet.apps.eighth.models.EighthBlockManager

class intranet.apps.eighth.models.EighthBlockManager(*args, **kwargs)[source]

Bases: Manager

Methods

get_blocks_this_year

Gets a QuerySet of blocks that occur this school year.

get_blocks_today

Gets a QuerySet of blocks that occur today.

get_first_upcoming_block

Gets the first upcoming block (the first block that will take place in the future).

get_next_upcoming_blocks

Gets the next upccoming blocks.

get_queryset

get_upcoming_blocks

Gets the given number of upcoming blocks that will take place in the future.

Attributes

get_blocks_this_year() QuerySet | Collection[EighthBlock][source]

Gets a QuerySet of blocks that occur this school year. :returns: A QuerySet of all the blocks that occur during this school year.

get_blocks_today() QuerySet | Collection[EighthBlock][source]

Gets a QuerySet of blocks that occur today. :returns: A QuerySet of all the blocks that occur today.

get_first_upcoming_block() EighthBlock[source]

Gets the first upcoming block (the first block that will take place in the future). :returns: The first upcoming EighthBlock object, or None if there are none upcoming.

get_next_upcoming_blocks() QuerySet | Collection[EighthBlock][source]

Gets the next upccoming blocks. It finds the other blocks that are occurring on the day of the first upcoming block. :returns: A QuerySet of the next upcoming EighthBlock objects.

get_upcoming_blocks(max_number: int = -1) QuerySet | Collection[EighthBlock][source]

Gets the given number of upcoming blocks that will take place in the future. If there is no block in the future, the most recent block will be returned. :returns: A QuerySet of the X upcoming EighthBlock objects.