Adding HTML Templates #1 | Django Hotel Management System [HMS] #4 | Django Programming Tutorial

preview_player
Показать описание
In this video, we are going to add HTML templates to our Django app.
This is the fourth video of our series.
We are going to make some radical changes in our forms and data handling,
so this might become a long video.

(Download code from here, if you want to follow from the video)

Рекомендации по теме
Комментарии
Автор

Darshan, thank you for uploading this type of video

tikamsuvasiya
Автор

Good work, man! Thanks for sharing.

You could also put some widget configuration in check_in and check_out fields of AvailabilityForm, so you could use Django's form.as_p :

class
room_category = forms.ChoiceField(choices=Room.ROOM_CATEGORIES, required=True, )
check_in = forms.DateTimeField(required=True,
input_formats=['%d/%m/%YT%H:%M', ],
'datetime-local'}))
check_out = forms.DateTimeField(required=True,
input_formats=['%d/%m/%YT%H:%M', ],
'datetime-local'}))

mayconblopes_
Автор

Bro i did the same but in room/nac its showing categroy doesnt exist

omkhard
Автор

how to get only date not date and time

olimbeknizomov
Автор

Good Job. Bro. Keep it up. I have been following this tutorial till I got to this part where I can't continue any longer because the template files, home.html, home.css, detail.html and detail.css are not available to use. The one I get at github is the complete work you have done. Please, try and get me a link to these particular 4 files so I can continue. Thank you.

oparesimon
Автор

please upload the complete series of HMS

tikamsuvasiya
Автор

def post(self, request, *args, **kwargs):
category = self.kwargs.get('category', None)
room_list =
form = AvailableForm (request.POST)
if form.is_valid():
data = form.cleaned_data
available_rooms = []
for room in room_list:
if check_availability(room, data['check_in'], data['check_out']):
available_rooms.append(room)

It is returning this error message
UnboundLocalError at /room/que/
cannot access local variable 'data' where it is not associated with a value

AMECOMGLOBAL