An idiom to use the same view function to create or edit an object?
I have looked at your code and I think that it actually looks pretty clean and straight forward. However, I would suggest that you make it more DRY by using reverse() to figure out what action to assign to the form.

views.py:

if task_id:
    action = reverse(edit, args=[task_id])
else:
    action = reverse(edit)
d['action'] = action


edit.html:

&lt;form action="{{ action }}" method="post"&gt;
    {{ form.as_p }}
    &lt;input type="submit" value="Save!" /&gt;
&lt;/form&gt;