Created
April 19, 2018 20:03
-
-
Save CoutinhoElias/529634bf859f5d203b93529711219837 to your computer and use it in GitHub Desktop.
MeuCodigoPython
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#View bookings_create | |
def bookings_create(request): | |
data = dict() | |
if request.method == 'POST': | |
form = BookingsForm(request.POST) | |
if form.is_valid(): | |
form.save() | |
data['form_is_valid'] = True | |
else: | |
data['form_is_valid'] = False | |
else: | |
form = BookingsForm() | |
form = BookingsForm() | |
context = {'form': form} | |
data['html_form'] = render_to_string('bookings_create.html', | |
context, | |
request=request, | |
) | |
return JsonResponse(data) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment