Re: Unique Fields and form submission validation

2009-10-07 Thread Streamweaver
I found a solution off of stack overflow. I had to bind an instance to the form when editing. So I changed the following line: form = ProjectForm(request.POST, instance=project) It seems to work and is in testing. On Oct 7, 5:40 pm, Streamweaver wrote: > Some more information. The view method

Re: Unique Fields and form submission validation

2009-10-07 Thread Streamweaver
Some more information. The view method to save the item is as follows: def update_project(request, slug): '''Method for editing already existing projects.''' project = get_object_or_404(Project, slug=slug) if request.method == 'POST': # If form was submitted run it through. f

Unique Fields and form submission validation

2009-10-07 Thread Streamweaver
The title field in my model is set to unique and when I use a form to edit this I get an error that an item with this value already exists. As I understand it this is because ModelForm throws an error when I call form.is_valid() and all information I can find tells me to override the clean method