I'm working on a basic event form created from a model, but I keep getting the following error message:
TypeError at /addlaundry/
addlaundry() takes exactly 1 argument (0 given)
I think it's because I'm not passing the argument through on views, but I can't find documented anywhere how to do this right, at least not written in a way I understand.
Here is my urls.py:
urlpatterns = patterns('',
url('^addlaundry/$', 'beacon.laundry.views.addlaundry'),
}
And the views itself:
# Create your views here.
from schedule.views import EventForm
def addlaundry(request):
if request.method == 'POST':
form = EventForm(request.POST)
if form.is_valid():
return HttpResponseRedirect('/thanks/') #redirect after succesfully adding new delivery
else:
form = addlaundry()
return render_to_response('newlaundry.html', {
'form': form,
})
Do I indeed have my views wrongly structured, or am I missing something else? If there's documentation I need to read up on, I want to I just haven't found it but feel like I'm missing something basic.
Thanks,
Michael