-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2728 from bcgov/464-uat-form-errors
464 uat form errors
- Loading branch information
Showing
15 changed files
with
291 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
161 changes: 161 additions & 0 deletions
161
bc_obps/reporting/migrations/0049_alter_gcs_add_CEMS.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
# Generated by Django 5.0.6 on 2024-07-10 20:27 | ||
|
||
from django.db import migrations | ||
|
||
#### CONFIG DATA #### | ||
|
||
|
||
def add_configuration_element_data(apps, schema_monitor): | ||
''' | ||
Add additional data to erc.configuration_element | ||
''' | ||
|
||
ConfigurationElement = apps.get_model('reporting', 'ConfigurationElement') | ||
Activity = apps.get_model('registration', 'Activity') | ||
SourceType = apps.get_model('reporting', 'SourceType') | ||
GasType = apps.get_model('reporting', 'GasType') | ||
Methodology = apps.get_model('reporting', 'Methodology') | ||
Configuration = apps.get_model('reporting', 'Configuration') | ||
ConfigurationElement.objects.bulk_create( | ||
[ | ||
# General stationary combustion excluding line tracing | ||
# CO2 - with production of useful energy | ||
ConfigurationElement( | ||
activity_id=Activity.objects.get(name='General stationary combustion excluding line tracing').id, | ||
source_type_id=SourceType.objects.get( | ||
name='General stationary combustion of fuel or waste with production of useful energy' | ||
).id, | ||
gas_type_id=GasType.objects.get(chemical_formula='CO2').id, | ||
methodology_id=Methodology.objects.get(name='CEMS').id, | ||
valid_from_id=Configuration.objects.get(valid_from='2023-01-01').id, | ||
valid_to_id=Configuration.objects.get(valid_to='2099-12-31').id, | ||
), | ||
# CO2 - without production of useful energy | ||
ConfigurationElement( | ||
activity_id=Activity.objects.get(name='General stationary combustion excluding line tracing').id, | ||
source_type_id=SourceType.objects.get( | ||
name='General stationary combustion of waste without production of useful energy' | ||
).id, | ||
gas_type_id=GasType.objects.get(chemical_formula='CO2').id, | ||
methodology_id=Methodology.objects.get(name='CEMS').id, | ||
valid_from_id=Configuration.objects.get(valid_from='2023-01-01').id, | ||
valid_to_id=Configuration.objects.get(valid_to='2099-12-31').id, | ||
), | ||
# General stationary combustion solely for the purpose of line tracing | ||
# CO2 - with production of useful energy | ||
ConfigurationElement( | ||
activity_id=Activity.objects.get( | ||
name='General stationary combustion solely for the purpose of line tracing' | ||
).id, | ||
source_type_id=SourceType.objects.get( | ||
name='General stationary combustion of fuel or waste with production of useful energy' | ||
).id, | ||
gas_type_id=GasType.objects.get(chemical_formula='CO2').id, | ||
methodology_id=Methodology.objects.get(name='CEMS').id, | ||
valid_from_id=Configuration.objects.get(valid_from='2023-01-01').id, | ||
valid_to_id=Configuration.objects.get(valid_to='2099-12-31').id, | ||
), | ||
# CO2 - without production of useful energy | ||
ConfigurationElement( | ||
activity_id=Activity.objects.get( | ||
name='General stationary combustion solely for the purpose of line tracing' | ||
).id, | ||
source_type_id=SourceType.objects.get( | ||
name='General stationary combustion of waste without production of useful energy' | ||
).id, | ||
gas_type_id=GasType.objects.get(chemical_formula='CO2').id, | ||
methodology_id=Methodology.objects.get(name='CEMS').id, | ||
valid_from_id=Configuration.objects.get(valid_from='2023-01-01').id, | ||
valid_to_id=Configuration.objects.get(valid_to='2099-12-31').id, | ||
), | ||
# General stationary combustion, other than non-compression and non-processing combustion | ||
# CO2 - with production of useful energy | ||
ConfigurationElement( | ||
activity_id=Activity.objects.get( | ||
name='General stationary combustion, other than non-compression and non-processing combustion' | ||
).id, | ||
source_type_id=SourceType.objects.get( | ||
name='General stationary combustion of fuel or waste at a linear facilities operation resulting in the production of useful energy' | ||
).id, | ||
gas_type_id=GasType.objects.get(chemical_formula='CO2').id, | ||
methodology_id=Methodology.objects.get(name='CEMS').id, | ||
valid_from_id=Configuration.objects.get(valid_from='2023-01-01').id, | ||
valid_to_id=Configuration.objects.get(valid_to='2099-12-31').id, | ||
), | ||
# CO2 - without production of useful energy | ||
ConfigurationElement( | ||
activity_id=Activity.objects.get( | ||
name='General stationary combustion, other than non-compression and non-processing combustion' | ||
).id, | ||
source_type_id=SourceType.objects.get( | ||
name='General stationary combustion of fuel or waste at a linear facilities operation not resulting in the production of useful energy' | ||
).id, | ||
gas_type_id=GasType.objects.get(chemical_formula='CO2').id, | ||
methodology_id=Methodology.objects.get(name='CEMS').id, | ||
valid_from_id=Configuration.objects.get(valid_from='2023-01-01').id, | ||
valid_to_id=Configuration.objects.get(valid_to='2099-12-31').id, | ||
), | ||
# CO2 - Field gas or process vent gas combustion at a linear facilities operation | ||
ConfigurationElement( | ||
activity_id=Activity.objects.get( | ||
name='General stationary combustion, other than non-compression and non-processing combustion' | ||
).id, | ||
source_type_id=SourceType.objects.get( | ||
name='Field gas or process vent gas combustion at a linear facilities operation' | ||
).id, | ||
gas_type_id=GasType.objects.get(chemical_formula='CO2').id, | ||
methodology_id=Methodology.objects.get(name='CEMS').id, | ||
valid_from_id=Configuration.objects.get(valid_from='2023-01-01').id, | ||
valid_to_id=Configuration.objects.get(valid_to='2099-12-31').id, | ||
), | ||
# General stationary non-compression and non-processing combustion | ||
# CO2 - with production of useful energy | ||
ConfigurationElement( | ||
activity_id=Activity.objects.get( | ||
name='General stationary non-compression and non-processing combustion' | ||
).id, | ||
source_type_id=SourceType.objects.get( | ||
name='General stationary combustion of fuel or waste at a linear facilities operation resulting in the production of useful energy' | ||
).id, | ||
gas_type_id=GasType.objects.get(chemical_formula='CO2').id, | ||
methodology_id=Methodology.objects.get(name='CEMS').id, | ||
valid_from_id=Configuration.objects.get(valid_from='2023-01-01').id, | ||
valid_to_id=Configuration.objects.get(valid_to='2099-12-31').id, | ||
), | ||
# CO2 - without production of useful energy | ||
ConfigurationElement( | ||
activity_id=Activity.objects.get( | ||
name='General stationary non-compression and non-processing combustion' | ||
).id, | ||
source_type_id=SourceType.objects.get( | ||
name='General stationary combustion of fuel or waste at a linear facilities operation not resulting in the production of useful energy' | ||
).id, | ||
gas_type_id=GasType.objects.get(chemical_formula='CO2').id, | ||
methodology_id=Methodology.objects.get(name='CEMS').id, | ||
valid_from_id=Configuration.objects.get(valid_from='2023-01-01').id, | ||
valid_to_id=Configuration.objects.get(valid_to='2099-12-31').id, | ||
), | ||
# CO2 - Field gas or process vent gas combustion at a linear facilities operation | ||
ConfigurationElement( | ||
activity_id=Activity.objects.get( | ||
name='General stationary non-compression and non-processing combustion' | ||
).id, | ||
source_type_id=SourceType.objects.get( | ||
name='Field gas or process vent gas combustion at a linear facilities operation' | ||
).id, | ||
gas_type_id=GasType.objects.get(chemical_formula='CO2').id, | ||
methodology_id=Methodology.objects.get(name='CEMS').id, | ||
valid_from_id=Configuration.objects.get(valid_from='2023-01-01').id, | ||
valid_to_id=Configuration.objects.get(valid_to='2099-12-31').id, | ||
), | ||
] | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [('reporting', '0048_remove_activitysourcetypejsonschema_invalid_if_has_unit_and_no_fuel')] | ||
|
||
operations = [ | ||
migrations.RunPython(add_configuration_element_data), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.