from django import forms
from .models import Garagem
from django.db import models


ANO = (
    (1990, 1990), (1991, 1991), (1992, 1992), (1993, 1993), (1994, 1994), (1995, 1995), (1996, 1996),
    (1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003),
    (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010),
    (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016), (2017, 2017),
    (2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021),
)

TIPO = (('Moto', 'Moto'), ('Carro', 'Carro'),)


class CadastroVeiculo(forms.Form):
    tipo = forms.ChoiceField(label='Tipo', required=True, choices=TIPO)
    modelo = forms.CharField(label='Modelo', max_length=100, required=True)
    ano_de_fabricacao = forms.ChoiceField(label='Ano de Fabricação', required=True, choices=ANO)
    cor = forms.CharField(label='Cor', max_length=50, required=True)


class CadastroGaragem(forms.Form):
    nome = forms.CharField(label='Nome', max_length=100, required=True)


class ParcialCadastroGaragem(forms.ModelForm):

    class Meta:
        model = Garagem
        fields = ('nome', 'veiculos')
