Thursday, September 29, 2022

Re: Elements don't render in my table

Olá, Boris!

Meu banco de dados está povoado, o problema é que não aparace na tabela. Isso ocorreu quando eu mudei o diretório da pasta gastos.html, pois antes estava funcionando perfeitamente. Antes era assim:

templates ---> paginas ---> listas ---> gastos.html ( Fica assim: "paginas/listas/gastos.html" )

Agora é:

templates ---> paginas ---> gastos.html ( Fica assim: "paginas/gastos.html" )

Foi depois dessa mudança que fiz de diretório que iniciaram os erros e o estranho, creio eu que coloquei tudo da forma certa para o jeito que é agora.

Em quinta-feira, 29 de setembro de 2022 às 10:29:40 UTC-3, Derek escreveu:
I find a quick way to check what data is actually going to the template is to print the whole object; so in your case probably {{ despesas }}

Its sometime the case that there is no actual data (so not really a problem with the template design).

If that does not work, try passing in a constant value to check the pipeline and rendering is working e.g. in the view : {'despesas': despesa_list, 'test': 'example' }

and then in the template  you access that constant via {{ test }}

HTH

On Wednesday, 28 September 2022 at 23:56:09 UTC+2 matheu...@gmail.com wrote:
Hello friends!

I've been trying to find my error for a while as to why my database items are not being printed in the table I created, I've looked at all my files and nothing!

Where is my mistake?

Thanks.

Here is the code:

Views.py


Urls.py


Table


Note: I am rendering my table in the 'paginas' app and their data is in the 'registrations' app


Thank you again!



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7de6a692-e28a-46f6-b7e5-00bedf3ae382n%40googlegroups.com.

No comments:

Post a Comment