-
Notifications
You must be signed in to change notification settings - Fork 18
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 #425 from datosgobar/424-config-models
Refactor de modelos singleton de configuración
- Loading branch information
Showing
15 changed files
with
200 additions
and
20 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
21 changes: 21 additions & 0 deletions
21
series_tiempo_ar_api/apps/analytics/migrations/0010_importconfig_time.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,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.6 on 2018-11-29 15:47 | ||
from __future__ import unicode_literals | ||
|
||
import datetime | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('analytics', '0009_importconfig_last_cursor'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='importconfig', | ||
name='time', | ||
field=models.TimeField(default=datetime.time(0, 0), help_text='Los segundos serán ignorados'), | ||
), | ||
] |
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
25 changes: 25 additions & 0 deletions
25
series_tiempo_ar_api/apps/dump/migrations/0008_auto_20181129_1247.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,25 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.6 on 2018-11-29 15:47 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('dump', '0007_auto_20181102_1542'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='dumpfile', | ||
name='file_type', | ||
field=models.CharField(choices=[('csv', 'CSV'), ('xlsx', 'XLSX'), ('zip', 'ZIP'), ('sqlite', 'SQL'), ('dta', 'DTA')], default='csv', max_length=12), | ||
), | ||
migrations.AlterField( | ||
model_name='generatedumptask', | ||
name='file_type', | ||
field=models.CharField(choices=[('csv', 'CSV'), ('xlsx', 'XLSX'), ('sql', 'SQL'), ('dta', 'DTA')], default='CSV', max_length=12), | ||
), | ||
] |
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
28 changes: 28 additions & 0 deletions
28
series_tiempo_ar_api/apps/management/migrations/0001_auto_20181129_1247.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 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.6 on 2018-11-29 15:47 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('management', 'reset_crons'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='TaskCron', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('time', models.TimeField(help_text='Los segundos serán ignorados')), | ||
('enabled', models.BooleanField(default=True)), | ||
('weekdays_only', models.BooleanField(default=False)), | ||
('task_script_path', models.CharField(default=None, max_length=255)), | ||
], | ||
), | ||
migrations.DeleteModel( | ||
name='IndexingTaskCron', | ||
), | ||
] |
33 changes: 33 additions & 0 deletions
33
series_tiempo_ar_api/apps/management/migrations/reset_crons.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,33 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Esta migración no va a funcionar a futuro si pasamos a dejar usar el storage de minio | ||
Debería borrarse en el caso que el storage no sea más minio! | ||
""" | ||
from __future__ import unicode_literals | ||
|
||
import os | ||
|
||
from django.conf import settings | ||
from django.db import migrations | ||
from django.core.files import File | ||
from minio_storage.errors import MinIOError | ||
from minio_storage.storage import MinioMediaStorage | ||
|
||
from django_datajsonar.models import Distribution | ||
|
||
|
||
def migrate_files(apps, schema_editor): | ||
IndexingTaskCron = apps.get_model('django_datajsonar', 'Metadata') | ||
db_alias = schema_editor.connection.alias | ||
|
||
IndexingTaskCron.objects.using(db_alias).all().delete() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('management', 'migrate_files_to_minio'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(migrate_files, reverse_code=lambda x, y: None) | ||
] |
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
26 changes: 26 additions & 0 deletions
26
series_tiempo_ar_api/apps/metadata/migrations/0003_metadataconfig.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,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.6 on 2018-11-29 17:10 | ||
from __future__ import unicode_literals | ||
|
||
import datetime | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('metadata', '0002_auto_20180813_1510'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='MetadataConfig', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('time', models.TimeField(default=datetime.time(0, 0), help_text='Los segundos serán ignorados')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
] |
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,6 @@ | ||
from solo.admin import SingletonModelAdmin | ||
|
||
|
||
class SingletonAdmin(SingletonModelAdmin): | ||
# django-des overridea el change_form_template de la clase padre(!), volvemos al default de django | ||
change_form_template = 'admin/change_form.html' |