Skip to content

Commit

Permalink
fixes issue #44
Browse files Browse the repository at this point in the history
The example app seems to be missing the form_class which is required
for CreateView and UpdateView.
  • Loading branch information
jangeador committed Aug 26, 2015
1 parent 53750f6 commit 95786ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions example/example/notes/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# coding=utf-8
from django.forms import ModelForm
from .models import Note


class NoteForm(ModelForm):
class Meta:
model = Note
fields = ['message', 'complete']
3 changes: 3 additions & 0 deletions example/example/notes/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.core.urlresolvers import reverse_lazy
from example.notes.models import Note
from example.notes.forms import NoteForm
from vanilla import CreateView, DeleteView, ListView, UpdateView


Expand All @@ -9,11 +10,13 @@ class ListNotes(ListView):

class CreateNote(CreateView):
model = Note
form_class = NoteForm
success_url = reverse_lazy('list_notes')


class EditNote(UpdateView):
model = Note
form_class = NoteForm
success_url = reverse_lazy('list_notes')


Expand Down

0 comments on commit 95786ef

Please sign in to comment.