# Generated by Django 3.2.5 on 2021-07-27 11:30

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Encarregado',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nameEncarregado', models.CharField(blank=True, default='', max_length=350, verbose_name='Nome do Encarregado')),
                ('localTrabalho', models.CharField(blank=True, default='', max_length=50, verbose_name='Local de Trabalho')),
                ('Profissao', models.CharField(blank=True, default='', max_length=50, verbose_name='Profissão')),
                ('cargo', models.CharField(blank=True, default='', max_length=50, verbose_name='Cargo')),
                ('grauParentesco', models.CharField(blank=True, default='', max_length=50, verbose_name='Grau de Parentesco')),
            ],
            options={
                'ordering': ('nameEncarregado',),
            },
        ),
        migrations.CreateModel(
            name='Endereco',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('provincia', models.CharField(blank=True, default='', max_length=30, verbose_name='Província')),
                ('cidade', models.CharField(blank=True, default='', max_length=30, verbose_name='Cidade')),
                ('distrito', models.CharField(blank=True, default='', max_length=30, verbose_name='Distrito')),
                ('bairro', models.CharField(blank=True, default='', max_length=30, verbose_name='Bairro')),
                ('av_rua', models.CharField(blank=True, default='', max_length=30, verbose_name='Av/Rua')),
                ('quarterao', models.CharField(blank=True, default='', max_length=5, verbose_name='Nº de Quarterão')),
                ('casa', models.CharField(blank=True, default='', max_length=5, verbose_name='Nº de Casa')),
            ],
            options={
                'ordering': ('provincia',),
            },
        ),
        migrations.CreateModel(
            name='Telefone',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('numero', models.CharField(blank=True, max_length=16, validators=[django.core.validators.RegexValidator(message="O numero deve ter esse formato: '+999999999'", regex='^\\+?1?\\d{5,15}$')], verbose_name='Nº telefone')),
            ],
            options={
                'ordering': ('numero',),
            },
        ),
        migrations.CreateModel(
            name='Filiacao',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('namePai', models.CharField(blank=True, default='', max_length=350, verbose_name='Nome do Pai')),
                ('nameMae', models.CharField(blank=True, default='', max_length=350, verbose_name='Nome do Mãe')),
                ('localTrabalhoPai', models.CharField(blank=True, default='', max_length=50, verbose_name='Local de Trabalho do Pai')),
                ('localTrabalhoMae', models.CharField(blank=True, default='', max_length=50, verbose_name='Local de Trabalho da Mãe')),
                ('ProfissaoPai', models.CharField(blank=True, default='', max_length=50, verbose_name='Profissão do Pai')),
                ('ProfissaoMae', models.CharField(blank=True, default='', max_length=50, verbose_name='Profissão da Mãe')),
                ('endereco', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='filiacaoEnderecos', to='estudante.endereco')),
                ('telefone', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='filiacaoTelefones', to='estudante.telefone')),
            ],
            options={
                'ordering': ('namePai',),
            },
        ),
        migrations.CreateModel(
            name='Estudante',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nameEstudante', models.CharField(blank=True, default='', max_length=350, verbose_name='Nome Completo')),
                ('dtNascimento', models.DateField(blank=True, null=True, verbose_name='Data de nascimento')),
                ('sexo', models.CharField(choices=[('M', 'Masculino'), ('F', 'Feminino')], max_length=1, verbose_name='Sexo')),
                ('estado_civil', models.CharField(choices=[('S', 'Solteiro'), ('C', 'Casado'), ('D', 'Divorciado'), ('V', 'Viúvo')], default='S', max_length=1, verbose_name='Estado civil')),
                ('email', models.CharField(blank=True, default='', max_length=250, unique=True, verbose_name='Email')),
                ('doc', models.FileField(blank=True, null=True, upload_to='documents/')),
                ('ndoc', models.CharField(blank=True, default='', max_length=20, unique=True, verbose_name='Nº de BI/Cédula')),
                ('dtDoc', models.DateField(blank=True, null=True, verbose_name='Data de Emissão')),
                ('image', models.ImageField(blank=True, null=True, upload_to='upload/')),
                ('thumbnail', models.ImageField(blank=True, null=True, upload_to='uploads/')),
                ('encarregado', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='estudanteEncarregados', to='estudante.encarregado')),
                ('endereco', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='estudanteEnderecos', to='estudante.endereco')),
                ('filiacao', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='estudanteFiliacoes', to='estudante.filiacao')),
                ('telefone', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='estudanteTelefones', to='estudante.telefone')),
            ],
            options={
                'ordering': ('nameEstudante',),
            },
        ),
        migrations.AddField(
            model_name='encarregado',
            name='endereco',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='encarregadoEnderecos', to='estudante.endereco'),
        ),
        migrations.AddField(
            model_name='encarregado',
            name='telefone',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='encarregadoTelefones', to='estudante.telefone'),
        ),
    ]
