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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/1c6c2ab1-f852-4503-81c5-d072cf2dbb02n%40googlegroups.com.