Matheus2037 / Matheus2037/DjangoFormsMysql
Refatoração do arquivo View.py, de FBV para CBV
@Matheus2037 is already working on this.
Since Aug 4, 2024.
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Esse projeto foi desenvolvido usando a **FBV (Function Based View)**, a ideia é refazer o arquivo por completo utilizando **CBV (Class Based View)**, e tentar manter todas as funcionalidades adicionadas na view.
> Um exemplo básico da FBV:
```
from django.shortcuts import render
def my_view(request):
context = {
'message': 'Hello, world!'
}
return render(request, 'my_template.html', context)
```
> Agora o mesmo exemplo, porém usando CBV:
```
from django.views.generic import TemplateView
class MyView(TemplateView):
template_name = 'my_template.html'
def get_context_data(self, **kwargs):
context = super(MyView, self).get_context_data(**kwargs)
context['message'] = 'Hello, world!'
return context
```
**OBS:** Alterações no arquivo **URLS.PY** também deverão ser realizadas para poder usar a CBV
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.