Skip to content

Instantly share code, notes, and snippets.

@neuman
Created November 20, 2014 22:42
Show Gist options
  • Save neuman/6dd189783a9f5d0283c4 to your computer and use it in GitHub Desktop.
Save neuman/6dd189783a9f5d0283c4 to your computer and use it in GitHub Desktop.
kenview
class KensView(MessageView):
def get_context_data(self, **kwargs):
kens_var = request.POST.get("kens_thing", "")
messages.info(request, 'kens message here')
# Call the base implementation first to get a context
context = super(MessageView, self).get_context_data(**kwargs)
# Add in a QuerySet of all the books
context['message'] = self.message
return context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment