from django import forms
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.contrib.auth import get_user_model
from django.core.mail import send_mail
from django.http import request
from django.shortcuts import render
from .models import Periodo, Endereco, Horario, HorarioAtividade
from django.contrib.admin import widgets
from datetime import date
from localflavor.br.br_states import STATE_CHOICES


class PeriodoForm(forms.ModelForm):
    data_inicio = forms.DateField(widget=forms.DateInput(attrs={'class': 'datepicker'}), required=False)
    data_fim = forms.DateField(widget=forms.DateInput(attrs={'class': 'datepicker'}), required=False)

    class Meta:
        model = Periodo
        fields = ('data_inicio', 'data_fim',)


class EnderecoForm(forms.ModelForm):
    pais = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'materialize-textarea'}),
                           required=False)
    estado = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'materialize-textarea'}),
                             required=False)
    cidade = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'materialize-textarea'}),
                             required=False)
    logradouro = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'materialize-textarea'}),
                                 required=False)
    numero = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'materialize-textarea'}),
                             required=False)
    cep = forms.CharField(max_length=8, widget=forms.TextInput(attrs={'class': 'materialize-textarea'}), required=False)

    # estado = forms.TypedChoiceField(choices=STATE_CHOICES, coerce=str,required=False)

    class Meta:
        model = Endereco
        # exclude =  ['pais','estado','cidade','logradouro']
        fields = ['cep']


class HorarioForm(forms.ModelForm):
    class Meta:
        model = Horario
        exclude = ['data']
        fields = '__all__'


class HorarioAtividadeForm(forms.ModelForm):
    data_inicio = forms.DateField(widget=forms.DateInput(attrs={'class': 'datepicker'}), required=False)
    data_fim = forms.DateField(widget=forms.DateInput(attrs={'class': 'datepicker'}), required=False)

    hora_inicio = forms.TimeField(widget=forms.TimeInput(format='%H:%M'))
    hora_fim = forms.TimeField(widget=forms.TimeInput(attrs={'class': 'timepicker'}), required=False)

    class Meta:
        model = HorarioAtividade
        fields = ('data_inicio', 'data_fim', 'hora_inicio', 'hora_fim')

ee545bef04620e02ea6e41a94c4c51c5a0e29b93
<mask token>


class EnderecoForm(forms.ModelForm):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>


    class Meta:
        model = Endereco
        fields = ['cep']


class HorarioForm(forms.ModelForm):


    class Meta:
        model = Horario
        exclude = ['data']
        fields = '__all__'


class HorarioAtividadeForm(forms.ModelForm):
    data_inicio = forms.DateField(widget=forms.DateInput(attrs={'class':
        'datepicker'}), required=False)
    data_fim = forms.DateField(widget=forms.DateInput(attrs={'class':
        'datepicker'}), required=False)
    hora_inicio = forms.TimeField(widget=forms.TimeInput(format='%H:%M'))
    hora_fim = forms.TimeField(widget=forms.TimeInput(attrs={'class':
        'timepicker'}), required=False)


    class Meta:
        model = HorarioAtividade
        fields = 'data_inicio', 'data_fim', 'hora_inicio', 'hora_fim'

<mask token>


class PeriodoForm(forms.ModelForm):
    <mask token>
    <mask token>


    class Meta:
        model = Periodo
        fields = 'data_inicio', 'data_fim'


class EnderecoForm(forms.ModelForm):
    pais = forms.CharField(max_length=200, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)
    estado = forms.CharField(max_length=200, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)
    cidade = forms.CharField(max_length=200, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)
    logradouro = forms.CharField(max_length=200, widget=forms.TextInput(
        attrs={'class': 'materialize-textarea'}), required=False)
    numero = forms.CharField(max_length=200, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)
    cep = forms.CharField(max_length=8, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)


    class Meta:
        model = Endereco
        fields = ['cep']


class HorarioForm(forms.ModelForm):


    class Meta:
        model = Horario
        exclude = ['data']
        fields = '__all__'


class HorarioAtividadeForm(forms.ModelForm):
    data_inicio = forms.DateField(widget=forms.DateInput(attrs={'class':
        'datepicker'}), required=False)
    data_fim = forms.DateField(widget=forms.DateInput(attrs={'class':
        'datepicker'}), required=False)
    hora_inicio = forms.TimeField(widget=forms.TimeInput(format='%H:%M'))
    hora_fim = forms.TimeField(widget=forms.TimeInput(attrs={'class':
        'timepicker'}), required=False)


    class Meta:
        model = HorarioAtividade
        fields = 'data_inicio', 'data_fim', 'hora_inicio', 'hora_fim'

<mask token>


class PeriodoForm(forms.ModelForm):
    data_inicio = forms.DateField(widget=forms.DateInput(attrs={'class':
        'datepicker'}), required=False)
    data_fim = forms.DateField(widget=forms.DateInput(attrs={'class':
        'datepicker'}), required=False)


    class Meta:
        model = Periodo
        fields = 'data_inicio', 'data_fim'


class EnderecoForm(forms.ModelForm):
    pais = forms.CharField(max_length=200, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)
    estado = forms.CharField(max_length=200, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)
    cidade = forms.CharField(max_length=200, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)
    logradouro = forms.CharField(max_length=200, widget=forms.TextInput(
        attrs={'class': 'materialize-textarea'}), required=False)
    numero = forms.CharField(max_length=200, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)
    cep = forms.CharField(max_length=8, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)


    class Meta:
        model = Endereco
        fields = ['cep']


class HorarioForm(forms.ModelForm):


    class Meta:
        model = Horario
        exclude = ['data']
        fields = '__all__'


class HorarioAtividadeForm(forms.ModelForm):
    data_inicio = forms.DateField(widget=forms.DateInput(attrs={'class':
        'datepicker'}), required=False)
    data_fim = forms.DateField(widget=forms.DateInput(attrs={'class':
        'datepicker'}), required=False)
    hora_inicio = forms.TimeField(widget=forms.TimeInput(format='%H:%M'))
    hora_fim = forms.TimeField(widget=forms.TimeInput(attrs={'class':
        'timepicker'}), required=False)


    class Meta:
        model = HorarioAtividade
        fields = 'data_inicio', 'data_fim', 'hora_inicio', 'hora_fim'

from django import forms
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.contrib.auth import get_user_model
from django.core.mail import send_mail
from django.http import request
from django.shortcuts import render
from .models import Periodo, Endereco, Horario, HorarioAtividade
from django.contrib.admin import widgets
from datetime import date
from localflavor.br.br_states import STATE_CHOICES


class PeriodoForm(forms.ModelForm):
    data_inicio = forms.DateField(widget=forms.DateInput(attrs={'class':
        'datepicker'}), required=False)
    data_fim = forms.DateField(widget=forms.DateInput(attrs={'class':
        'datepicker'}), required=False)


    class Meta:
        model = Periodo
        fields = 'data_inicio', 'data_fim'


class EnderecoForm(forms.ModelForm):
    pais = forms.CharField(max_length=200, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)
    estado = forms.CharField(max_length=200, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)
    cidade = forms.CharField(max_length=200, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)
    logradouro = forms.CharField(max_length=200, widget=forms.TextInput(
        attrs={'class': 'materialize-textarea'}), required=False)
    numero = forms.CharField(max_length=200, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)
    cep = forms.CharField(max_length=8, widget=forms.TextInput(attrs={
        'class': 'materialize-textarea'}), required=False)


    class Meta:
        model = Endereco
        fields = ['cep']


class HorarioForm(forms.ModelForm):


    class Meta:
        model = Horario
        exclude = ['data']
        fields = '__all__'


class HorarioAtividadeForm(forms.ModelForm):
    data_inicio = forms.DateField(widget=forms.DateInput(attrs={'class':
        'datepicker'}), required=False)
    data_fim = forms.DateField(widget=forms.DateInput(attrs={'class':
        'datepicker'}), required=False)
    hora_inicio = forms.TimeField(widget=forms.TimeInput(format='%H:%M'))
    hora_fim = forms.TimeField(widget=forms.TimeInput(attrs={'class':
        'timepicker'}), required=False)


    class Meta:
        model = HorarioAtividade
        fields = 'data_inicio', 'data_fim', 'hora_inicio', 'hora_fim'

from django import forms
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.contrib.auth import get_user_model
from django.core.mail import send_mail
from django.http import request
from django.shortcuts import render
from .models import Periodo, Endereco, Horario, HorarioAtividade
from django.contrib.admin import widgets
from datetime import date
from localflavor.br.br_states import STATE_CHOICES


class PeriodoForm(forms.ModelForm):
    data_inicio = forms.DateField(widget=forms.DateInput(attrs={'class': 'datepicker'}), required=False)
    data_fim = forms.DateField(widget=forms.DateInput(attrs={'class': 'datepicker'}), required=False)

    class Meta:
        model = Periodo
        fields = ('data_inicio', 'data_fim',)


class EnderecoForm(forms.ModelForm):
    pais = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'materialize-textarea'}),
                           required=False)
    estado = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'materialize-textarea'}),
                             required=False)
    cidade = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'materialize-textarea'}),
                             required=False)
    logradouro = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'materialize-textarea'}),
                                 required=False)
    numero = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'materialize-textarea'}),
                             required=False)
    cep = forms.CharField(max_length=8, widget=forms.TextInput(attrs={'class': 'materialize-textarea'}), required=False)

    # estado = forms.TypedChoiceField(choices=STATE_CHOICES, coerce=str,required=False)

    class Meta:
        model = Endereco
        # exclude =  ['pais','estado','cidade','logradouro']
        fields = ['cep']


class HorarioForm(forms.ModelForm):
    class Meta:
        model = Horario
        exclude = ['data']
        fields = '__all__'


class HorarioAtividadeForm(forms.ModelForm):
    data_inicio = forms.DateField(widget=forms.DateInput(attrs={'class': 'datepicker'}), required=False)
    data_fim = forms.DateField(widget=forms.DateInput(attrs={'class': 'datepicker'}), required=False)

    hora_inicio = forms.TimeField(widget=forms.TimeInput(format='%H:%M'))
    hora_fim = forms.TimeField(widget=forms.TimeInput(attrs={'class': 'timepicker'}), required=False)

    class Meta:
        model = HorarioAtividade
        fields = ('data_inicio', 'data_fim', 'hora_inicio', 'hora_fim')
