intranet.apps.signage package¶
Subpackages¶
Submodules¶
intranet.apps.signage.admin module¶
- class intranet.apps.signage.admin.PageAdmin(model, admin_site)[source]¶
Bases:
ModelAdmin
- actions = ['add_page_to_all_signs', 'remove_page_from_all_signs', 'lock_page_to_all_signs', 'unlock_all_signs_from_selected_pages', 'set_custom_switch_page_for_all_signs', 'set_locked_custom_switch_page_for_all_signs', 'remove_custom_switch_page_from_all_signs', 'set_custom_switch_time_for_all_signs']¶
- list_display = ('name', 'url', 'template', 'order', 'sign_list', 'lock_page_on', 'custom_page_on')¶
intranet.apps.signage.consumers module¶
intranet.apps.signage.forms module¶
- class intranet.apps.signage.forms.SetSignCustomSwitchTimeForm(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, field_order=None, use_required_attribute=None, renderer=None)[source]¶
Bases:
Form
- declared_fields = {'_selected_action': <django.forms.fields.CharField object>, 'action': <django.forms.fields.CharField object>, 'time': <django.forms.fields.TimeField object>}¶
intranet.apps.signage.models module¶
- class intranet.apps.signage.models.Page(*args, **kwargs)[source]¶
Bases:
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:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- button¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- custom_page_signs¶
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- default_signs¶
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- deploy_to(displays=None, exclude=None, lock=False)[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.
- locked_signs¶
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
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.
- strip_links¶
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:
QuerySet
- order_properly() QuerySet [source]¶
Returns a QuerySet containing all the pages in this QuerySet, but sorted in ascending order by their
order
field (falling back onid
when theorder
fields for two pages are the same).- Returns:
A QuerySet containing all the pages in this QuerySet sorted by their
order
andid
fields in ascending order.
- class intranet.apps.signage.models.Sign(*args, **kwargs)[source]¶
Bases:
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:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- custom_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 aForwardManyToOneDescriptor
instance.
- custom_switch_page_id¶
- custom_switch_page_lock¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- custom_switch_time¶
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_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 aForwardManyToOneDescriptor
instance.
- day_end_switch_page_id¶
- 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 aForwardManyToOneDescriptor
instance.
- default_page_id¶
- 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.
- 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 aForwardManyToOneDescriptor
instance.
- lock_page_id¶
- 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
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.
- class intranet.apps.signage.models.SignQuerySet(model=None, query=None, using=None, hints=None)[source]¶
Bases:
QuerySet
- class intranet.apps.signage.models.Sign_pages(id, sign, page)¶
Bases:
Model
- 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>¶
- 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 aForwardManyToOneDescriptor
instance.
- page_id¶
- 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 aForwardManyToOneDescriptor
instance.
- sign_id¶
intranet.apps.signage.pages module¶
intranet.apps.signage.tests module¶
intranet.apps.signage.urls module¶
intranet.apps.signage.views module¶
- intranet.apps.signage.views.check_internal_ip(request) Optional[HttpResponse] [source]¶
A method to determine if a request is allowed to load a signage page.
Denies access by returning None unless the user is authenticated and not restricted, or the request IP address is in
settings.INTERNAL_IPS
.- Returns:
a 403 if the request is unauthorized or None if the request is authorized
- 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..