Models

class festivalgrid.models.APIUser(id, username, password, token)[source]
Parameters
  • id (AutoField) – Id

  • username (CharField) – Username

  • password (CharField) – Password

  • token (CharField) – Token

exception DoesNotExist
exception MultipleObjectsReturned
id

Model field: ID

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

Model field: password

token

Model field: token

username

Model field: username

class festivalgrid.models.Connection(id, plug, socket, geojson)[source]
Parameters
  • id (AutoField) – Id

  • plug (ForeignKey to Node) – Plug

  • socket (ForeignKey to Node) – Socket

  • geojson (TextField) – Geojson

exception DoesNotExist
exception MultipleObjectsReturned
geojson

Model field: geojson

id

Model field: ID

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

Model field: plug, accesses the Node model.

plug_id

Model field: plug

socket

Model field: socket, accesses the Node model.

socket_id

Model field: socket

class festivalgrid.models.Device(id, name, template, mqtt_topic, ip, hostname, mac)[source]
Parameters
  • id (AutoField) – Id

  • name (CharField) – Name

  • template (CharField) – Template

  • mqtt_topic (CharField) – Mqtt topic

  • ip (GenericIPAddressField) – Ip

  • hostname (CharField) – Hostname

  • mac (CharField) – Mac

exception DoesNotExist
exception MultipleObjectsReturned
get_template()[source]
hostname

Model field: hostname

id

Model field: ID

ip

Model field: ip

mac

Model field: mac

mqtt_topic

Model field: mqtt topic

name

Model field: name

nodes

Model field: device, accesses the M2M Node model.

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

Model field: template

class festivalgrid.models.ImageLayer(id, image, latitude1, longitude1, latitude2, longitude2, latitude3, longitude3)[source]
Parameters
  • id (AutoField) – Id

  • image (FileField) – Image

  • latitude1 (DecimalField) – Latitude1

  • longitude1 (DecimalField) – Longitude1

  • latitude2 (DecimalField) – Latitude2

  • longitude2 (DecimalField) – Longitude2

  • latitude3 (DecimalField) – Latitude3

  • longitude3 (DecimalField) – Longitude3

exception DoesNotExist
exception MultipleObjectsReturned
id

Model field: ID

image

Model field: image Return type: FieldFile

latitude1

Model field: latitude1

latitude2

Model field: latitude2

latitude3

Model field: latitude3

longitude1

Model field: longitude1

longitude2

Model field: longitude2

longitude3

Model field: longitude3

objects = <django.db.models.manager.Manager object>
class festivalgrid.models.Node(id, name, device, warning_level, shutdown_level, cut_power, latitude, longitude)[source]
Parameters
  • id (AutoField) – Id

  • name (CharField) – Name

  • device (ForeignKey to Device) – Device

  • warning_level (IntegerField) – Warning level

  • shutdown_level (IntegerField) – Shutdown level

  • cut_power (BooleanField) – Cut power

  • latitude (DecimalField) – Latitude

  • longitude (DecimalField) – Longitude

exception DoesNotExist
exception MultipleObjectsReturned
__init__(*args, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

cut_power

Model field: cut power

device

Model field: device, accesses the Device model.

device_id

Model field: device

id

Model field: ID

latitude

Model field: latitude

longitude

Model field: longitude

name

Model field: name

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

Model field: plug, accesses the M2M Connection model.

save(force_insert=False, force_update=False, *args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

shutdown_level

Model field: shutdown level

sockets

Model field: socket, accesses the M2M Connection model.

timers

Model field: node, accesses the M2M Timer model.

warning_level

Model field: warning level

class festivalgrid.models.Timer(id, name, node, time, action, enabled)[source]
Parameters
  • id (AutoField) – Id

  • name (CharField) – Name

  • node (ForeignKey to Node) – Node

  • time (TimeField) – Time

  • action (CharField) – Action

  • enabled (BooleanField) – Enabled

ACTION_CHOICES = (('ON', 'On'), ('OFF', 'Off'), ('TOGGLE', 'Toggle'))
exception DoesNotExist
exception MultipleObjectsReturned
action

Model field: action

enabled

Model field: enabled

get_action_display(*, field=<django.db.models.fields.CharField: action>)

Autogenerated: Shows the label of the action

id

Model field: ID

name

Model field: name

node

Model field: node, accesses the Node model.

node_id

Model field: node

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

Model field: time