O
O
ooker2020-10-09 16:48:09
Django
ooker, 2020-10-09 16:48:09

How to output an array (days of the month) in django?

Good afternoon!
Question for the experts. There is a front code
(((div class="month-year" style="text-align: center; font-weight: bold;"{% now 'M' %}/div
table class="grafik-tabel"
tr class ="metka-aktiv" td class="metka" /td td Tue /td td class="sel-date" 1 /td td 09:00-18:00 /td td>NON BREAK /td> /tr>
tr class="metka-aktiv td class="metka" /td td СР /td td class="sel-date" 2 /td>09:00-18:00NO BREAK /td /tr
etc. (tags removed for correct display here)
Is it possible to display an array from django in the name of the day, the number, and at the top the month.When you click on the arrow with the month, a list of days was displayed on the page.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita, 2020-10-20
@buslay

Everything is mixed up in a heap - Django, layout, event handling .. From django, in a format understandable to the browser, you can display anything you like. To understand, show at least a screenshot of what you want to see in the end.
"on clicking on the arrow.." - if this arrow is a "self-made" element of the page, in order for the "click" event to be processed, you need to make a "handler" for this event in Javascript, which can manipulate the list of data received from Django on page preload as a set of tags, or in JSON format by Ajax request.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question