Matheus2037 / Matheus2037/DjangoFormsMysql

Refatoração do arquivo View.py, de FBV para CBV

Open
#1 0 comments 0 reactions 1 assignee View on GitHub

@Matheus2037 is already working on this.

Since Aug 4, 2024.

enhancement good first issue
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.