-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DBC22-1804: populate data, serializer, and starting frontend logic
- Loading branch information
Showing
24 changed files
with
546 additions
and
16 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
7 changes: 7 additions & 0 deletions
7
src/backend/apps/weather/management/commands/populate_current.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,7 @@ | ||
from apps.weather.tasks import populate_all_current_weather_data | ||
from django.core.management.base import BaseCommand | ||
|
||
|
||
class Command(BaseCommand): | ||
def handle(self, *args, **options): | ||
populate_all_current_weather_data() |
14 changes: 14 additions & 0 deletions
14
src/backend/apps/weather/management/commands/test_current.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,14 @@ | ||
from pprint import pprint | ||
|
||
from apps.weather.models import CurrentWeather | ||
from apps.weather.serializers import CurrentWeatherSerializer | ||
from django.core.management.base import BaseCommand | ||
|
||
|
||
class Command(BaseCommand): | ||
|
||
def handle(self, *args, **options): | ||
c = CurrentWeather.objects.get(id=275) | ||
serializer = CurrentWeatherSerializer(c) | ||
serializer = serializer.data | ||
pprint(serializer) |
56 changes: 56 additions & 0 deletions
56
src/backend/apps/weather/migrations/0001_squashed_0005_alter_currentweather_datasets.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,56 @@ | ||
# Generated by Django 4.2.3 on 2024-02-29 18:55 | ||
|
||
import django.contrib.gis.db.models.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
replaces = [('weather', '0001_initial'), ('weather', '0002_rename_location_code_regionalweather_code_and_more'), ('weather', '0003_rename_location_name_regionalweather_name'), ('weather', '0004_currentweather'), ('weather', '0005_alter_currentweather_datasets')] | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='RegionalWeather', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('modified_at', models.DateTimeField(auto_now=True)), | ||
('code', models.CharField(max_length=10, null=True)), | ||
('location_latitude', models.CharField(max_length=10, null=True)), | ||
('location_longitude', models.CharField(max_length=10, null=True)), | ||
('name', models.CharField(max_length=100, null=True)), | ||
('region', models.CharField(max_length=255, null=True)), | ||
('observation_name', models.CharField(max_length=50, null=True)), | ||
('observation_zone', models.CharField(max_length=10, null=True)), | ||
('observation_utc_offset', models.IntegerField(null=True)), | ||
('observation_text_summary', models.CharField(max_length=255, null=True)), | ||
('conditions', models.JSONField(null=True)), | ||
('forecast_group', models.JSONField(null=True)), | ||
('hourly_forecast_group', models.JSONField(null=True)), | ||
('location', django.contrib.gis.db.models.fields.PointField(null=True, srid=4326)), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='CurrentWeather', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('modified_at', models.DateTimeField(auto_now=True)), | ||
('weather_station_name', models.CharField(max_length=100)), | ||
('elevation', models.IntegerField(null=True)), | ||
('location_description', models.TextField(null=True)), | ||
('datasets', models.JSONField(default=[], null=True)), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
] |
28 changes: 28 additions & 0 deletions
28
src/backend/apps/weather/migrations/0004_currentweather.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,28 @@ | ||
# Generated by Django 4.2.3 on 2024-02-22 23:26 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('weather', '0003_rename_location_name_regionalweather_name'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='CurrentWeather', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('modified_at', models.DateTimeField(auto_now=True)), | ||
('weather_station_name', models.CharField(max_length=100)), | ||
('elevation', models.IntegerField(null=True)), | ||
('location_description', models.TextField(null=True)), | ||
('datasets', models.JSONField(default=[])), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
src/backend/apps/weather/migrations/0005_alter_currentweather_datasets.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,18 @@ | ||
# Generated by Django 4.2.3 on 2024-02-26 17:55 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('weather', '0004_currentweather'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='currentweather', | ||
name='datasets', | ||
field=models.JSONField(default=[], null=True), | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
src/backend/apps/weather/migrations/0006_currentweather_location_latitude_and_more.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,23 @@ | ||
# Generated by Django 4.2.3 on 2024-02-29 23:27 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('weather', '0001_squashed_0005_alter_currentweather_datasets'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='currentweather', | ||
name='location_latitude', | ||
field=models.CharField(max_length=10, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='currentweather', | ||
name='location_longitude', | ||
field=models.CharField(max_length=10, null=True), | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
src/backend/apps/weather/migrations/0007_alter_currentweather_location_latitude_and_more.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,23 @@ | ||
# Generated by Django 4.2.3 on 2024-03-01 23:17 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('weather', '0006_currentweather_location_latitude_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='currentweather', | ||
name='location_latitude', | ||
field=models.CharField(max_length=20, null=True), | ||
), | ||
migrations.AlterField( | ||
model_name='currentweather', | ||
name='location_longitude', | ||
field=models.CharField(max_length=20, null=True), | ||
), | ||
] |
Oops, something went wrong.