mirror of https://github.com/interlegis/sapl.git
4 changed files with 16 additions and 53 deletions
@ -1,33 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-06-03 11:26 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('painel', '0003_auto_20190603_0815'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='TipoCronometro', |
|||
fields=[ |
|||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|||
('nome', models.CharField(max_length=100, verbose_name='Tipo Cronômetro')), |
|||
], |
|||
options={ |
|||
'verbose_name': 'Tipo de Cronômetro', |
|||
'verbose_name_plural': 'Tipos de Cronômetro', |
|||
'ordering': ['nome'], |
|||
}, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='cronometro', |
|||
name='tipo', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='painel.TipoCronometro', verbose_name='Tipo Cronômetro'), |
|||
), |
|||
] |
|||
@ -1,24 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-06-03 11:42 |
|||
# Generated by Django 1.11.20 on 2019-06-03 13:10 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
def create_default_tipos_cronometro(apps, schema_editor): |
|||
TipoCronometro = apps.get_model('painel', 'TipoCronometro') |
|||
def create_default_cronometros(apps, schema_editor): |
|||
tipos_default = ['Cronômetro do Discurso', 'Cronômetro do Aparte', |
|||
'Cronômetro da Ordem', 'Cronômetro de Considerações Finais'] |
|||
Cronometro = apps.get_model('painel', 'Cronometro') |
|||
for tipo in tipos_default: |
|||
TipoCronometro.objects.get_or_create(nome=tipo) |
|||
Cronometro.objects.get_or_create(tipo=tipo, duracao_cronometro='00:30:00', status='S') |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('painel', '0004_auto_20190603_0826'), |
|||
('painel', '0003_auto_20190603_1009'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RunPython(create_default_tipos_cronometro) |
|||
migrations.RunPython(create_default_cronometros) |
|||
] |
|||
Loading…
Reference in new issue