Wednesday, March 17, 2021

Re: Calendar based on JS/JQuery needs to communicate with Django

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

On March 17, 2021 5:14:36 AM CDT, Manuel Buri <manuel.buri@gmail.com> wrote:
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

No comments:

Post a Comment