resource manager package.
The model for the resource manager.
-
class apps.managers.resource_mgr.models.EnergyUsage(*args, **kwargs)[source]
Energy usage model.
Parameters: |
- id (AutoField) – Id
- team_id (ForeignKey) – Team
- date (DateField) – The date when the usage or reading is recorded.
- time (TimeField) – The time of the day when the usage or reading is recorded.
- manual_meter_reading (IntegerField) – The daily manual reading of the meter, in the unit defined in ResourceSetting. only needed when manually reading the meter.
- usage (IntegerField) – The daily usage, if manual_meter_reading is input and the reading from the day before is available, this will be automatically calculated.
- created_at (DateTimeField) – Created at
- updated_at (DateTimeField) – Updated at
|
-
save(*args, **kwargs)[source]
Custom save method to set fields.
-
class apps.managers.resource_mgr.models.ResourceBlackoutDate(*args, **kwargs)[source]
defines the blackout dates for the resource related games.
Parameters: |
- id (AutoField) – Id
- date (DateField) – The date when the resource usage should be ignored.
- description (CharField) – The description of the date.
|
-
class apps.managers.resource_mgr.models.ResourceSetting(*args, **kwargs)[source]
resource settings model.
Parameters: |
- id (AutoField) – Id
- name (CharField) – The name of the resource.
- unit (CharField) – The unit of the resource, such as kWh, Gallon, etc.
- conversion_rate (IntegerField) – The rate of converting the usage data into the unit. For example, 1000 could be specified to convert usage data recorded in Wh to kWh.
- winning_order (CharField) – The winning order. Ascending indicates the lesser/smaller wins.
|
-
save(*args, **kwargs)[source]
Custom save method.
-
class apps.managers.resource_mgr.models.ResourceUsage(*args, **kwargs)[source]
abstract resource usage model.
Parameters: |
- team_id (ForeignKey) – Team
- date (DateField) – The date when the usage or reading is recorded.
- time (TimeField) – The time of the day when the usage or reading is recorded.
- manual_meter_reading (IntegerField) – The daily manual reading of the meter, in the unit defined in ResourceSetting. only needed when manually reading the meter.
- usage (IntegerField) – The daily usage, if manual_meter_reading is input and the reading from the day before is available, this will be automatically calculated.
- created_at (DateTimeField) – Created at
- updated_at (DateTimeField) – Updated at
|
-
class Meta[source]
Meta
-
class apps.managers.resource_mgr.models.WasteUsage(*args, **kwargs)[source]
Water usage model.
Parameters: |
- id (AutoField) – Id
- team_id (ForeignKey) – Team
- date (DateField) – The date when the usage or reading is recorded.
- time (TimeField) – The time of the day when the usage or reading is recorded.
- manual_meter_reading (IntegerField) – The daily manual reading of the meter, in the unit defined in ResourceSetting. only needed when manually reading the meter.
- usage (IntegerField) – The daily usage, if manual_meter_reading is input and the reading from the day before is available, this will be automatically calculated.
- created_at (DateTimeField) – Created at
- updated_at (DateTimeField) – Updated at
|
-
save(*args, **kwargs)[source]
Custom save method to set fields.
-
class apps.managers.resource_mgr.models.WaterUsage(*args, **kwargs)[source]
Water usage model.
Parameters: |
- id (AutoField) – Id
- team_id (ForeignKey) – Team
- date (DateField) – The date when the usage or reading is recorded.
- time (TimeField) – The time of the day when the usage or reading is recorded.
- manual_meter_reading (IntegerField) – The daily manual reading of the meter, in the unit defined in ResourceSetting. only needed when manually reading the meter.
- usage (IntegerField) – The daily usage, if manual_meter_reading is input and the reading from the day before is available, this will be automatically calculated.
- created_at (DateTimeField) – Created at
- updated_at (DateTimeField) – Updated at
|
-
save(*args, **kwargs)[source]
Custom save method to set fields.