In the browser it looks ugly, why?

15 views
Skip to first unread message

Barkalez XX

unread,
Apr 6, 2019, 9:28:25 PM4/6/19
to Django users
Why does this happen to me?






 html:                        https://dpaste.de/AVti  


 views.py:            https://dpaste.de/44Jz   


 models.py:         https://dpaste.de/Dfwy



I want to list all the ingredients in that recipe and make it look beautiful.

Alex Heyden

unread,
Apr 6, 2019, 11:31:14 PM4/6/19
to django...@googlegroups.com
Short answer, it's giving you exactly what you asked for: the query set inside <ul> tags.
What you probably want is to loop through the ingredients and place them inside <li> tags. Something like:
<ul>
{% for ingredient in object.ingredientes.all %}
<li>{{ ingredient.cantidad }} {{ ingredient.nombre }}</li>
{% endfor %}
</ul>

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/07ff0403-914f-46ae-a418-6c42a9de8ac2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages