Created
January 29, 2018 20:43
-
-
Save jaredlockhart/7ca0967dd71a807e2a4dc1d3601f534a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class ProjectEditMixin(object) | |
model = Project | |
form_class = ProjectForm | |
template_name = 'projects/edit.html' | |
def get_success_url(self): | |
return reverse('projects-detail', kwargs={'slug': self.object.slug}) | |
class ProjectCreateView(ProjectEditMixin, CreateView): | |
pass | |
class ProjectUpdateView(ProjectEditMixin, UpdateView): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment