4.2.2.14. Package apps.widgets.resource_goal

Implements the widgets for resource goal games (energy, water, etc.)

4.2.2.14.1. Module apps.widgets.resource_goal.models

Energy goal model definition.

class apps.widgets.resource_goal.models.EnergyBaselineDaily(*args, **kwargs)[source]

Daily Team energy baseline Model for a week

Parameters:
  • id (AutoField) – Id
  • team_id (ForeignKey) – The team which this baseline is related to.
  • day (IntegerField) – The day in the week
  • usage (IntegerField) – The baseline usage of the day.
  • updated_at (DateTimeField) – Updated at
class apps.widgets.resource_goal.models.EnergyBaselineHourly(*args, **kwargs)[source]

Hourly Team energy baseline Model for a week

Parameters:
  • id (AutoField) – Id
  • team_id (ForeignKey) – The team which this baseline is related to.
  • day (IntegerField) – The day in the week.
  • hour (IntegerField) – The hour in the day.
  • usage (IntegerField) – The baseline usage of the day.
  • updated_at (DateTimeField) – Updated at
class apps.widgets.resource_goal.models.EnergyGoal(*args, **kwargs)[source]

Energy goal

Parameters:
  • id (AutoField) – Id
  • team_id (ForeignKey) – The team which this goal is related to.
  • date (DateField) – The date of the goal.
  • actual_usage (IntegerField) – The actual usage, cache of the usage in ResourceUsage.
  • baseline_usage (IntegerField) – The baseline usage, cache of the usage in BaselineDaily.
  • goal_usage (IntegerField) – The goal usage, derived from baseline and goal percentage.
  • percent_reduction (IntegerField) – The percentage of reduction over the goal usage, derived from actual and goal usage
  • current_goal_percent_reduction (IntegerField) – The current goal percentage of reduction, calculated from the initial valuein GoalSetting.
  • goal_status (CharField) – The status of the goal.
  • updated_at (DateTimeField) – Updated at
class apps.widgets.resource_goal.models.EnergyGoalSetting(*args, **kwargs)[source]

Energy goal settings.

Parameters:
  • id (AutoField) – Id
  • team_id (ForeignKey) – The team which this goal is related to.
  • goal_percent_reduction (IntegerField) – The goal percentage of reduction.
  • baseline_method (CharField) – The method of calculating the baseline.
  • data_storage (CharField) – The storage service of the usage data.
  • wattdepot_source_name (CharField) – The source name in wattdepot server for the team. It defaults to the team name.
  • goal_points (IntegerField) – The amount of points to award for completing a goal.
  • manual_entry (BooleanField) – Manually enter the data?
  • manual_entry_time (TimeField) – The time for manual data entry.
  • realtime_meter_interval (IntegerField) – The refresh interval (in seconds) for the real-time meter display. not applicable when the Manual Entry is checked.
save(*args, **kwargs)[source]

Custom save method to set fields.

class apps.widgets.resource_goal.models.ResourceBaselineDaily(*args, **kwargs)[source]

Daily Team resource baseline Model for a week

Parameters:
  • team_id (ForeignKey) – The team which this baseline is related to.
  • day (IntegerField) – The day in the week
  • usage (IntegerField) – The baseline usage of the day.
  • updated_at (DateTimeField) – Updated at
class Meta[source]

Meta

class apps.widgets.resource_goal.models.ResourceBaselineHourly(*args, **kwargs)[source]

Daily Team resource baseline Model for a week

Parameters:
  • team_id (ForeignKey) – The team which this baseline is related to.
  • day (IntegerField) – The day in the week.
  • hour (IntegerField) – The hour in the day.
  • usage (IntegerField) – The baseline usage of the day.
  • updated_at (DateTimeField) – Updated at
class Meta[source]

Meta

class apps.widgets.resource_goal.models.ResourceGoal(*args, **kwargs)[source]

Team Resource Goal Model

Parameters:
  • team_id (ForeignKey) – The team which this goal is related to.
  • date (DateField) – The date of the goal.
  • actual_usage (IntegerField) – The actual usage, cache of the usage in ResourceUsage.
  • baseline_usage (IntegerField) – The baseline usage, cache of the usage in BaselineDaily.
  • goal_usage (IntegerField) – The goal usage, derived from baseline and goal percentage.
  • percent_reduction (IntegerField) – The percentage of reduction over the goal usage, derived from actual and goal usage
  • current_goal_percent_reduction (IntegerField) – The current goal percentage of reduction, calculated from the initial valuein GoalSetting.
  • goal_status (CharField) – The status of the goal.
  • updated_at (DateTimeField) – Updated at
class Meta[source]

Meta

class apps.widgets.resource_goal.models.ResourceGoalSetting(*args, **kwargs)[source]

Team Resource Goal Setting Model

Parameters:
  • team_id (ForeignKey) – The team which this goal is related to.
  • goal_percent_reduction (IntegerField) – The goal percentage of reduction.
  • baseline_method (CharField) – The method of calculating the baseline.
  • data_storage (CharField) – The storage service of the usage data.
  • wattdepot_source_name (CharField) – The source name in wattdepot server for the team. It defaults to the team name.
  • goal_points (IntegerField) – The amount of points to award for completing a goal.
  • manual_entry (BooleanField) – Manually enter the data?
  • manual_entry_time (TimeField) – The time for manual data entry.
  • realtime_meter_interval (IntegerField) – The refresh interval (in seconds) for the real-time meter display. not applicable when the Manual Entry is checked.
class Meta[source]

Meta

class apps.widgets.resource_goal.models.WaterBaselineDaily(*args, **kwargs)[source]

Daily Team water baseline Model for a week

Parameters:
  • id (AutoField) – Id
  • team_id (ForeignKey) – The team which this baseline is related to.
  • day (IntegerField) – The day in the week
  • usage (IntegerField) – The baseline usage of the day.
  • updated_at (DateTimeField) – Updated at
class apps.widgets.resource_goal.models.WaterBaselineHourly(*args, **kwargs)[source]

Hourly Team water baseline Model for a week

Parameters:
  • id (AutoField) – Id
  • team_id (ForeignKey) – The team which this baseline is related to.
  • day (IntegerField) – The day in the week.
  • hour (IntegerField) – The hour in the day.
  • usage (IntegerField) – The baseline usage of the day.
  • updated_at (DateTimeField) – Updated at
class apps.widgets.resource_goal.models.WaterGoal(*args, **kwargs)[source]

Water goal

Parameters:
  • id (AutoField) – Id
  • team_id (ForeignKey) – The team which this goal is related to.
  • date (DateField) – The date of the goal.
  • actual_usage (IntegerField) – The actual usage, cache of the usage in ResourceUsage.
  • baseline_usage (IntegerField) – The baseline usage, cache of the usage in BaselineDaily.
  • goal_usage (IntegerField) – The goal usage, derived from baseline and goal percentage.
  • percent_reduction (IntegerField) – The percentage of reduction over the goal usage, derived from actual and goal usage
  • current_goal_percent_reduction (IntegerField) – The current goal percentage of reduction, calculated from the initial valuein GoalSetting.
  • goal_status (CharField) – The status of the goal.
  • updated_at (DateTimeField) – Updated at
class apps.widgets.resource_goal.models.WaterGoalSetting(*args, **kwargs)[source]

Water goal settings

Parameters:
  • id (AutoField) – Id
  • team_id (ForeignKey) – The team which this goal is related to.
  • goal_percent_reduction (IntegerField) – The goal percentage of reduction.
  • baseline_method (CharField) – The method of calculating the baseline.
  • data_storage (CharField) – The storage service of the usage data.
  • wattdepot_source_name (CharField) – The source name in wattdepot server for the team. It defaults to the team name.
  • goal_points (IntegerField) – The amount of points to award for completing a goal.
  • manual_entry (BooleanField) – Manually enter the data?
  • manual_entry_time (TimeField) – The time for manual data entry.
  • realtime_meter_interval (IntegerField) – The refresh interval (in seconds) for the real-time meter display. not applicable when the Manual Entry is checked.
save(*args, **kwargs)[source]

Custom save method to set fields.

4.2.2.14.2. Module apps.widgets.resource_goal.views