Last active
December 26, 2015 20:39
-
-
Save chriskief/7210290 to your computer and use it in GitHub Desktop.
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
from django.views.generic import UpdateView | |
from app.views.mixins.ajaxformresponse import AjaxFormResponseMixin | |
from app.forms.author import UpdateAuthorForm | |
from app.lib.shortcuts import get_object_or_json404 | |
from app.models.author import Author | |
class AjaxAuthorUpdateView(AjaxFormResponseMixin, UpdateView): | |
form_class = UpdateAuthorForm | |
def get_object(self, queryset=None): | |
return get_object_or_json404(Author, pk=self.kwargs['pk']) | |
def get_context_data(self, context): | |
context['success'] = True | |
return context |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment