Hello kevin,

There are several django booking apps like this
https://github.com/bernii/django-reservations

I think its easier to change existing code to your requirements then begin
from strech.

Good luck

Kevin gallagher <galdalfthegr...@gmail.com> schrieb am Mi., 2. Nov. 2022,
18:04:

> Hi guys,
> Im currently learning django and am doing a project for college. Im
> building an appointment website users can book a training session. These
> are my models:
>
> class TimeSlot(models.Model):
>
>     title = models.CharField(max_length=50)
>
>     def __str__(self):
>         return f'There is a slot at {self.title}'
>
>
> class Booking(models.Model):
>
>     user = models.ForeignKey(settings.AUTH_USER_MODEL,
>                              on_delete=models.CASCADE)
>     time_slot = models.ForeignKey(TimeSlot, on_delete=models.CASCADE)
>     booking_date = models.DateField(("Date"), default=date.today)
>
>     def __str__(self):
>         return f'{self.user} has booked a session at {self.timeslot.title}
> on {self.booking_date}'
>
> I have the title field set as available session times, 1-2pm, 3-4pm etc.
> I want the user to select a date and then be able to see what time slots
> are still available to book but I'm kind of lost and confused. Any help
> would be much appreciated!
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1c6c2ab1-f852-4503-81c5-d072cf2dbb02n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/1c6c2ab1-f852-4503-81c5-d072cf2dbb02n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKGT9mys0yJGpE_TOW87ruPnvvxWzwh-Jo%2B3MrDSt_j9dmK4-A%40mail.gmail.com.

Reply via email to