
# Views do Models $ModelClass$
class $ModelClass$ListView(BaseListView):
    """Classe para gerenciar a listagem do $ModelClass$ """
    model = $ModelClass$
    context_object_name = '$model_name$'
    ## variaveis abaixo são opcionais
    #template_name = "$app_name$/$model_name$_list.html"



class $ModelClass$DetailView(BaseDetailView):
    """Classe para gerenciar o detalhe do $ModelClass$ """
    model = $ModelClass$
    form_class = $ModelClass$Form
    context_object_name = '$model_name$'
    ## variaveis abaixo são opcionais
    #success_url = "$app_name$:$model_name$-list"
    #template_name = '$app_name$/$model_name$_detail.html'



class $ModelClass$CreateView(BaseCreateView):
    """Classe para gerenciar a criação do $ModelClass$ """
    model = $ModelClass$
    form_class = $ModelClass$Form
    context_object_name = '$model_name$'
    ## variaveis abaixo são opcionais
    #success_url = "$app_name$:$model_name$-list"
    #template_name = '$app_name$/$model_name$_create.html'
    #inlines = []

    #em caso de uso de modal siga esse exemplo
    #def get_context_data(self, **kwargs):
    #    context = super($ModelClass$CreateView, self).get_context_data(**kwargs)
    #    context['form_MODEL_DA_FOREIGN_KEY'] = MODEL_FOREIGN_KEY_FORM #  exemplo context['form_classepai'] = ClassePaiForm
    #    return context


class $ModelClass$UpdateView(BaseUpdateView):
    """Classe para gerenciar a atualização do $ModelClass$ """
    model = $ModelClass$
    form_class = $ModelClass$Form
    context_object_name = '$model_name$'
    ## variaveis abaixo são opcionais
    #success_url = "$app_name$:$model_name$-list"
    #template_name = '$app_name$/$model_name$_update.html'

    #em caso de uso de modal siga esse exemplo
    #def get_context_data(self, **kwargs):
    #    context = super($ModelClass$UpdateView, self).get_context_data(**kwargs)
    #    context['form_MODEL_DA_FOREIGN_KEY'] = MODEL_FOREIGN_KEY_FORM #  exemplo context['form_classepai'] = ClassePaiForm
    #    return context


class $ModelClass$DeleteView(BaseDeleteView):
    """Classe para gerenciar a exclusão do $ModelClass$ """
    model = $ModelClass$
    form_class = $ModelClass$Form
    context_object_name = '$model_name$'
    ## variaveis abaixo são opcionais
    #success_url = "$app_name$:$model_name$-list"
    #template_name = '$app_name$/$model_name$_delete.html'


# Fim das Views do Models $ModelClass$
