-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add solar schedules * Flake and cleanup for tests * Fix extra characters * Change verbose_name for Solar model * Force uniqueness for Solar fields * Wrong field name for longitude
- Loading branch information
Showing
5 changed files
with
151 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.3 on 2016-11-18 03:46 | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('django_celery_beat', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='SolarSchedule', | ||
fields=[ | ||
('id', models.AutoField( | ||
auto_created=True, primary_key=True, | ||
serialize=False, verbose_name='ID')), | ||
('event', models.CharField( | ||
choices=[('dusk_nautical', 'dusk_nautical'), | ||
('dawn_astronomical', 'dawn_astronomical'), | ||
('dawn_nautical', 'dawn_nautical'), | ||
('dawn_civil', 'dawn_civil'), | ||
('sunset', 'sunset'), | ||
('solar_noon', 'solar_noon'), | ||
('dusk_astronomical', 'dusk_astronomical'), | ||
('sunrise', 'sunrise'), | ||
('dusk_civil', 'dusk_civil')], | ||
max_length=24, verbose_name='event')), | ||
('latitude', models.DecimalField( | ||
decimal_places=6, max_digits=9, verbose_name='latitude')), | ||
('longitude', models.DecimalField( | ||
decimal_places=6, max_digits=9, verbose_name='latitude')), | ||
], | ||
options={ | ||
'ordering': ['event', 'latitude', 'longitude'], | ||
'verbose_name': 'solar', | ||
'verbose_name_plural': 'solars', | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name='periodictask', | ||
name='solar', | ||
field=models.ForeignKey( | ||
blank=True, help_text='Use a solar schedule', | ||
null=True, on_delete=django.db.models.deletion.CASCADE, | ||
to='django_celery_beat.SolarSchedule', verbose_name='solar'), | ||
), | ||
] |
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,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.11 on 2016-12-09 00:49 | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('django_celery_beat', '0002_auto_20161118_0346'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='solarschedule', | ||
options={ | ||
'ordering': ('event', 'latitude', 'longitude'), | ||
'verbose_name': 'solar event', | ||
'verbose_name_plural': 'solar events'}, | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='solarschedule', | ||
unique_together=set([('event', 'latitude', 'longitude')]), | ||
), | ||
] |
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