Skip to content

Instantly share code, notes, and snippets.

@ckinsey
Created October 31, 2013 13:51
Show Gist options
  • Save ckinsey/7250117 to your computer and use it in GitHub Desktop.
Save ckinsey/7250117 to your computer and use it in GitHub Desktop.
Python flow control as determined by the text of a button set via JavaScript.
if self.request.POST.get('action').lower().find('book') > -1:
# if everything on the other side was all set to go and the user making changes,
# the button they are pushing contains "book" on it and we can redirect to booking this session.
return HttpResponseRedirect(reverse('setup_payment_for_session', kwargs={'pk': obj.pk}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment