BjornRodin / book-a-contractor

0 stars 1 forks source link

USER STORY: <Book a session> #6

Open BjornRodin opened 1 year ago

BjornRodin commented 1 year ago

As a Site User I can click the button on the home-page so that I can make a booking

Acceptance Criteria

Tasks

BjornRodin commented 1 year ago

Had big issues with loading the crispy form due to a "TemplateDoesNotExist" error. After a ton of testing and reading stackoverflow and crispy forms documentation, for example this: https://stackoverflow.com/questions/75495403/django-returns-templatedoesnotexist-when-using-crispy-forms So i've tried changing APP_DIRS to "False" instead of True, uninstalling, reinstalling other versions, checked and double checked the installed apps and more. After installing crispy-bootstrap4 it should have worked, but I had forgot about the APP_DIRS that i changed earlier in another attempt. When that was set to True again it finally worked and the form is now displayed in the correct html.

BjornRodin commented 1 year ago

Added a help text for the date and time because it needs a specific format. However, I started to look into a DateTimePicker so I will work on that to make it easier for the user and then the field will always be filled the same way.

BjornRodin commented 1 year ago

After getting stuck in with the datepicker i wanted to add i had some import issues mainly. I tried reinstalling different versions, adding and removing from installed apps and still couldn't get it to work. I finally found https://stackoverflow.com/questions/57285137/bootstrap-datepicker-not-working-in-django where i found my exact error and there was a comment that i needed to change the import to "from bootstrap_datepicker_plus.widgets import DatePickerInput, TimePickerInput" instead of "from bootstrap_datepicker_plus import DatePickerInput, TimePickerInput".

Now it works as intended.