Calendar based on JS/JQuery needs to communicate with Django

29 views
Skip to first unread message

Manuel Buri

unread,
Mar 17, 2021, 6:14:36 AM3/17/21
to Django users
Hello,

I am having a website where people are able to make bookings for offices. Clients will click on the calendar that is rendered in JS/JQuery (on client side) to select a date and then book for a specific date via a button. To store the booking in my database I am using an Ajax call, which works fine. However, I am asking myself now, how can I properly display all bookings for the specific dates? I am not sure how to properly retrieve and show the database entries on the client side as dates are selected via JS and JQuery.

I was thinking about using slugs, but then I am unsure how to put the content of the slug (e.g 2021/03/17) into my JS/JQuery code to then properly render the calendar again on the client side.

Maybe my approach is totally wrong and I would need to setup my architecture differently. I am open to any suggestions, however, obviously want to do as few changes.

Thank you so much!! Manuel

Ryan Nowakowski

unread,
Mar 17, 2021, 9:04:19 AM3/17/21
to django...@googlegroups.com
You probably don't need a slug just to group by date. Take a look at the regroup and date template tags:

https://stackoverflow.com/a/1255076/226697
Reply all
Reply to author
Forward
0 new messages