- The user would like to book one or more guests for a meal in a restaurant at a particular time and date
- Site Navigation: As a Site User I can easily navigate the site so that I can view the menu, sign up, and manage my bookings
- Admin Manage bookings: As a Site Admin I can create, view, update and cancel bookings so that I can manage my table bookings
- Sign-up: As a Site User I can register an account so that I can sign-in with username and password
- Reset password: As a Site User I can reset my password myself so that I don't have to ask webmaster
- Sign-in with Social Networks: As a Site User I can use a social network so that I can sign-in to the site
- View table availability: In order to book a table as a Site User I can see available tables
- Make booking: As a Site User I can make Date/time bookings
- Book multiple tables: As a Site User I can make multiple table occupancy bookings so that I can take a larger party
- Change booking: As a Site User I can update my booking so that I can increase or reduce the number of tables booked
- Change booking date: As a Site User I can update my booking date so that I can change the date to earlier or later date
- Cancel booking: As a Site User I can cancel a booking
- View menu: As a Site User I can view the menu so that I can decide on meals beforehand
- Contact form: As a Site User I can submit a contact form so that I can get support from the restaurant
- Admin Confirm bookings: As a Site Admin I can approve bookings so that I can better plan bookings
- Password reset: As a Site User I can request a password reset and receive email confirmation so that **I can access my account if I have forgotten my password
- Email Contact form: As a Site User I will receive an email confirmation of my contact form submission
- Signup email verification: As a Site User I will need to verify my signup via an email verification link
- About page: As a Site User I can navigate to the About page so that **I can view a brief intro to Herb’s Restaurant and it’s business hours
- View Bookings: As a Site User I can view all my booking so that I make better plan my events and also cancel or change bookings
- On Signup Add User: As a Site User when I sign up the app will add my details to the user table
- Created test cases to test the BookingForm. Test file name: test_bookingform.py
- Tests to confirm that the form is only valid if all required fields are completed
- Tests to confirm that only the necessary field are displayed on the form
- Created test cases to test the ContactForm. Test file name: test_contactform.py
- Tests are run to confirm that the form is only valid if all required fields are completed
- Tests to confirm that only the necessary field are displayed on the form
- Not tested: Confirm field is read-only/disabled.
- Created test cases to test the all view templates render
- Created test case to test that adding a contact or submitting a contact form works as expected
- Created test cases to verify that the user can:
- Create a booking
- Update/make changes to a booking
- Delete a booking
- Mark a booking as cancelled
- Tested the Home, Menu, About pages. These all work as expected.
- Tested that a user can make a booking
- An email is sent to the restaurant admin advising of the new booking
- The booking is listed on the user's booking listing
- for each line item a 'Change' and 'Cancel' button is activated
- Tested that a user can change booking details
- once a change is made to booking, if the booking had already been confirmed by restaurant admin, the status of the booking will be reset from confirm='Yes' to confirm='No'
- Tested that the user can delete a record
- Delete option/button was replaced by the cancel button
- On deleting a booking an email is sent to the restaurant admin
- Tested that the user can cancel a booking
- When a user cancels a booking confirm is set to 'Cancel'
- The option to cancel a booking is preferable, as the record will still be visible to the admin
- Once the user cancels the booking, the booking is no longer displayed to the user
- On cancelling a booking an email is sent to the restaurant admin
- Functionality can be added later to provide conditions permitting a user to delete a booking
- Tested viewing the OPEN TABLES VIEW.
- Only open tables are displayed
- Tested the contact form
- An email is sent to the admin with the content of the content form
- The contact table is updated with the content of the content form
- Login/Sign up works as expected.
- New users will receive and email to validate their account
-
CSS
-
Lighthouse
- Images not found when deployed to heroku
- because some styles sheets and images definitions in the template were not in block tags
- Also added
{% load static %}
to all templates due to block end error
- Styling and images not found when deployed
- installed whitenoise package
- Fixed variable EMAIL_USE_TLS, was incorrect as EMAIL_USES_TLS (Thanks Ian Meigh for spotting it for me - post in Slack)
- After hours of figuring out how "it" works, then going through error after error, the brain swells and the simplest typo is blocked from your sight
- BookingAdmin class -- confirm functions -- admin.py
- previously working (somehow) with two parameters,
def confirm_booking(self, queryset):
, when simply changing confirm from 0 to 1 and vice versa. 0 being No and 1 being Yes. - after changing the field type from integer to char and adding an additional option of 'cancel' I received this error:
- confirm_booking() takes 2 positional arguments but 3 were given
- After scouring the web for possible causes I came up empty handed. I decided to look deeper into the detail and found my solution from looking into:
- File "/workspace/.pip-modules/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1408, in response_action response = func(self, request, queryset)
- Adding 'request' as a second parameter solved the issue:
def confirm_booking(self, request, queryset):
- previously working (somehow) with two parameters,
- Booking template
- after changing confirm field from integer to char in booking model I didn't remove the conditional statement from the booking template used to set confirm 0 to No and 1 to Yes. This displayed inconsistant values.
- TimeInput - when updating a booking the time was not pulled into the form
- Cause: the format on the booking_time field was:
format=('%h:%m')
instead offormat=('%H:%M')
- Cause: the format on the booking_time field was:
- created date is updating to current date on update of a record
- HTML/CSS
- Javascript
- Python+Django
- Sqlite3
- Postgres
- Cloudinary
- GitHub
- GitPod
- I used the "https://startbootstrap.com/previews/business-casual" as my template
- I used the part of social network links layout from my tourguide project
- The home page image I is from Pexel and icons_for_free
- pexels-foodie-factor-551997.avif
- pexels-rachel-claire-4577396.avif
- pexels-nataliya-vaitkevich-5605543.avif
- pexels-min-an-1482803.avif
- pexels-dana-tentis-1213710.avif
- pexels-rajesh-tp-1633578.avif
- Used convertio.co, compressjpeg.com, cleancss.com, geeksforgeeks.org
- Guided by django blog project
- Support from stackoverflow.com, web.dev, slack
- django documentation
- djangoproject.com
- geeksforgeeks.org
- w3schools.com
- Slack
- stackoverflow
- simpleisbetterthancomplex.com
-
The link to the deployed app:
-
The app was deployed using the Heroku App