intranet.apps.signage package

Submodules

intranet.apps.signage.admin module

class intranet.apps.signage.admin.PageAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('name',)
class intranet.apps.signage.admin.SignAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('name', 'display')

intranet.apps.signage.consumers module

class intranet.apps.signage.consumers.SignageConsumer(*args, **kwargs)[source]

Bases: channels.generic.websocket.JsonWebsocketConsumer

connect()None[source]
disconnect(code: int)None[source]
receive_json(content)None[source]

intranet.apps.signage.models module

class intranet.apps.signage.models.Page(*args, **kwargs)[source]

Bases: django.db.models.base.Model

iframe: True if page is just an iframe url: url for iframe (if iframe is True) sandbox: whether the iframe should be sandboxed

template: the path to the template (for server side rendering) button: the name of the fontawesome icon (ex: “fa-chrome”) order: index at which button should be placed

strip_links: whether we strip the links in the iframe (to prevent navigation away)

signs: set of signs which display this Page

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

button

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

deploy_to(displays=None, exclude=None)[source]

Deploys page to listed display (specify with display). If display is None, deploy to all display. Can specify exclude for which display to exclude. This overwrites the first argument.

function

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.

iframe

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.ManagerFromPageQuerySet object>
order

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

sandbox

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

signs

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.

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

template

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.signage.models.PageQuerySet(model=None, query=None, using=None, hints=None)[source]

Bases: django.db.models.query.QuerySet

order_properly() → models.query.QuerySet[Page][source]

Returns a QuerySet containing all the pages in this QuerySet, but sorted in ascending order by their order field (falling back on id when the order fields for two pages are the same).

Returns

A QuerySet containing all the pages in this QuerySet sorted by their order and id fields in ascending order.

class intranet.apps.signage.models.Sign(*args, **kwargs)[source]

Bases: django.db.models.base.Model

name: friendly display name [required] display: unique name (should match hostname of pi/compute stick) [required]

eighth_block_increment: … landscape: if display is in landscape orientation map_location: location of display on map

lock_page: if set, the signage will only display this page default_page: if set, the signage will revert to this page after a set

amount of time

day_end_switch_page: A page to switch to near the end of the day day_end_switch_minutes: The number of minutes before the end of the day to switch

to day_end_switch_page. Can be negative to switch after the end of the day.

latest_heartbeat_time: If the sign has an open websocket connection to a

SignageConsumer, this is the time at which the last message was received from it. If the sign does not have such a connection open, this is None (even if the sign previously had an open connection).

pages: a list of pages

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

day_end_switch_minutes

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

day_end_switch_page

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_end_switch_page_id

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

default_page

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.

default_page_id

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

display

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

eighth_block_increment

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.

img_path

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

property is_offline
landscape

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

latest_heartbeat_time

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

lock_page

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.

lock_page_id

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

map_location

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.ManagerFromSignQuerySet object>
pages

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.

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

Bases: django.db.models.query.QuerySet

filter_offline() → models.query.QuerySet[Sign][source]
filter_online() → models.query.QuerySet[Sign][source]
class intranet.apps.signage.models.Sign_pages(id, sign, page)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.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>
page

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.

page_id

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

sign

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.

sign_id

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

intranet.apps.signage.pages module

intranet.apps.signage.pages.announcements(page, sign, request)[source]
intranet.apps.signage.pages.bus(page, sign, request)[source]
intranet.apps.signage.pages.hello_world(page, sign, request)[source]

intranet.apps.signage.urls module

intranet.apps.signage.views module

intranet.apps.signage.views.check_internal_ip(request)[source]
intranet.apps.signage.views.eighth(request)[source]

Displays the eighth period signage page. This cannot be a regular signage page because it needs to reload in order to switch blocks or update information..

intranet.apps.signage.views.prometheus_metrics(request)[source]

Prometheus metrics for signage displays. Currently just whether or not they are online.

intranet.apps.signage.views.signage_display(request, display_id)[source]

Module contents