quando vou buscar no site aparece o seguinte erro
def buscar(request):
lista_receitas = receita_modelo.objects.order_by('-data_receita').filter(publicada=True)
if 'buscar' in request.GET:
nome_buscar = request.GET['buscar']
if nome_buscar:
lista_receitas = lista_receitas.fillter(nome_receita__icontains=nome_buscar)
dados = {
'receitas': lista_receitas,
}
return render(request, 'buscar.html',dados)
AttributeError at /buscar
'QuerySet' object has no attribute 'fillter'
Request Method: GET
Request URL: http://127.0.0.1:8000/buscar?buscar=a
Django Version: 2.2.6
Exception Type: AttributeError
Exception Value:
'QuerySet' object has no attribute 'fillter'
Exception Location: C:\Users\PC-Gamer\PycharmProject\APPDJANGO\receita\views.py in buscar, line 21
Python Executable: C:\Users\PC-Gamer\PycharmProject\APPDJANGO\venv\Scripts\python.exe
Python Version: 3.6.5
Python Path:
['C:\\Users\\PC-Gamer\\PycharmProject\\APPDJANGO',
'C:\\Users\\PC-Gamer\\PycharmProject\\APPDJANGO\\venv\\Scripts\\python36.zip',
'C:\\Users\\PC-Gamer\\AppData\\Local\\Programs\\Python\\Python36\\DLLs',
'C:\\Users\\PC-Gamer\\AppData\\Local\\Programs\\Python\\Python36\\lib',
'C:\\Users\\PC-Gamer\\AppData\\Local\\Programs\\Python\\Python36',
'C:\\Users\\PC-Gamer\\PycharmProject\\APPDJANGO\\venv',
'C:\\Users\\PC-Gamer\\PycharmProject\\APPDJANGO\\venv\\lib\\site-packages']
Server time: Dom, 20 Fev 2022 08:21:13 -0300
Traceback Switch to copy-and-paste view
C:\Users\PC-Gamer\PycharmProject\APPDJANGO\venv\lib\site-packages\django\core\handlers\exception.py in inner
response = get_response(request) …
▶ Local vars
C:\Users\PC-Gamer\PycharmProject\APPDJANGO\venv\lib\site-packages\django\core\handlers\base.py in _get_response
response = self.process_exception_by_middleware(e, request) …
▶ Local vars
C:\Users\PC-Gamer\PycharmProject\APPDJANGO\venv\lib\site-packages\django\core\handlers\base.py in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs) …
▶ Local vars
C:\Users\PC-Gamer\PycharmProject\APPDJANGO\receita\views.py in buscar
lista_receitas = lista_receitas.fillter(nome_receita__icontains=nome_buscar) …
▶ Local vars