Skip to content

Commit

Permalink
[UPDATE] Permite campos nulos na espécie para permitir inserção via f…
Browse files Browse the repository at this point in the history
…ront #15
  • Loading branch information
fernao committed Jun 11, 2019
1 parent 6877e1c commit 30905d1
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 6 deletions.
18 changes: 18 additions & 0 deletions app/especie/migrations/0002_auto_20190610_2109.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.2 on 2019-06-11 02:09

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('especie', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='especie',
name='tolerancia_poda',
field=models.PositiveSmallIntegerField(blank=True, choices=[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9)], null=True, verbose_name='tolerancia_poda'),
),
]
39 changes: 39 additions & 0 deletions app/especie/migrations/0003_auto_20190610_2110.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by Django 2.2.2 on 2019-06-11 02:10

from django.db import migrations, models
import multiselectfield.db.fields


class Migration(migrations.Migration):

dependencies = [
('especie', '0002_auto_20190610_2109'),
]

operations = [
migrations.AlterField(
model_name='especie',
name='estrato',
field=models.CharField(blank=True, choices=[('Baixo', 'Baixo'), ('Médio', 'Médio'), ('Alto/dossel', 'Alto/dossel'), ('Emergente', 'Emergente')], max_length=30, null=True, verbose_name='estrato'),
),
migrations.AlterField(
model_name='especie',
name='exigencia_sol',
field=models.PositiveSmallIntegerField(blank=True, choices=[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9)], null=True, verbose_name='exigencia_sol'),
),
migrations.AlterField(
model_name='especie',
name='formas_plantio',
field=multiselectfield.db.fields.MultiSelectField(blank=True, choices=[('semente', 'semente'), ('muda', 'muda'), ('estaca', 'estaca'), ('rama', 'rama'), ('tubérculo', 'tubérculo')], max_length=30, null=True, verbose_name='formas_plantio'),
),
migrations.AlterField(
model_name='especie',
name='inicio_colheita',
field=models.CharField(blank=True, max_length=5, null=True, verbose_name='inicio_colheita'),
),
migrations.AlterField(
model_name='especie',
name='sucessao',
field=models.CharField(blank=True, choices=[('Colonizadora', 'Colonizadora'), ('Pioneiras', 'Pioneiras'), ('Secundárias iniciais', 'Secundárias iniciais'), ('Secundárias tardias', 'Secundárias tardias'), ('Clímax', 'Clímax')], max_length=30, null=True, verbose_name='sucessao'),
),
]
12 changes: 6 additions & 6 deletions app/especie/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ class Especie(models.Model):
unidade_tempo_vida = models.CharField('unidade_tempo_vida', max_length=1, choices=Configuracoes.UNIDADE_TEMPO_VIDA, default="M")
umidade = models.CharField('umidade', max_length=30, choices=Configuracoes.TIPOS_UMIDADE, blank=True)
exigencia_solo = models.CharField('exigencia_solo', max_length=30, choices=Configuracoes.TIPOS_SOLO, blank=True)
tolerancia_poda = models.PositiveSmallIntegerField('tolerancia_poda', choices=Configuracoes.NUMBER_RANGE, blank=True)
exigencia_sol = models.PositiveSmallIntegerField('exigencia_sol', choices=Configuracoes.NUMBER_RANGE, blank=True)
inicio_colheita = models.CharField('inicio_colheita', max_length=5, blank=True)
estrato = models.CharField('estrato', max_length=30, choices=Configuracoes.TIPOS_ESTRATO, blank=True)
sucessao = models.CharField('sucessao', max_length=30, choices=Configuracoes.TIPOS_SUCESSAO, blank=True)
tolerancia_poda = models.PositiveSmallIntegerField('tolerancia_poda', choices=Configuracoes.NUMBER_RANGE, blank=True, null=True)
exigencia_sol = models.PositiveSmallIntegerField('exigencia_sol', choices=Configuracoes.NUMBER_RANGE, blank=True, null=True)
inicio_colheita = models.CharField('inicio_colheita', max_length=5, blank=True, null=True)
estrato = models.CharField('estrato', max_length=30, choices=Configuracoes.TIPOS_ESTRATO, blank=True, null=True)
sucessao = models.CharField('sucessao', max_length=30, choices=Configuracoes.TIPOS_SUCESSAO, blank=True, null=True)
imagem = models.ImageField(upload_to=get_image_path, blank=True, null=True)
formas_plantio = MultiSelectField('formas_plantio', max_length=30, choices=Configuracoes.FORMAS_PLANTIO, blank=True, max_choices=4)
formas_plantio = MultiSelectField('formas_plantio', max_length=30, choices=Configuracoes.FORMAS_PLANTIO, blank=True, max_choices=4, null=True)

def __str__(self):
return self.nomes_populares + " (" + self.nome_cientifico + ")"
Expand Down

0 comments on commit 30905d1

Please sign in to comment.