I'm writing my first app in Django, and I have a problem with the create_object Generic View; In my urls.py, I have:

(r'^new$', CreateView.as_view()),

The problem is that when the user submits the "new" form, I need to manipulate the data that will be saved to the database (I actually need to add the user_id foreign key); without Generic Views I used to write:

    form = ClientForm(request.POST)
    if form.is_valid():
        data = form.save(commit=False)
        data.user = request.user
        data.save()
        form.save_m2m()

in my view (notice data.user=request.user). I've searched Django docs but I can't find a way to do this (maybe by extending the CreateView class) - somewere in The Book there is only an example that overrides the get_object method of a ListView class to update a last_accessed_date field.

Edit
Report