title: Best practices on saving in a view, based on example code
body: <p>I'm new to Django and looking for best practices on the code I just wrote (below). The code currently exists in my view.py and simply creates a new event. Being familiar with other languages it just 'smells bad' if you know what I mean. Could someone point out how they would do this simple task.</p>
  
  <p>The only thing looking at my code again (and from reading the docs a little more), would be to move the request.user into the models.py save function. </p>
  
  <p>Anything else which is a big newbie mistake below?</p>
  
  <pre><code>@login_required
  def event_new(request):
      # If we had a POST then get the request post values.
      if request.method == 'POST':
          form = EventForm(request.POST)
          # Check we have valid data
          if form.is_valid():
              # If form has passed all validation checks then continue to save it.
              city = City.objects.get(name=form.cleaned_data['autocompleteCity'])
              category = form.cleaned_data['category']
              event = Event(
                  name=form.cleaned_data['name'],
                  details=form.cleaned_data['details'],
                  date=form.cleaned_data['date'],
                  start=form.cleaned_data['start'],
                  end=form.cleaned_data['end'],
                  category=category,
                  city=city,
                  user=request.user,
              )
              event.save()
  
              messages.add_message(request, messages.SUCCESS, 'Event has been created.')
              return HttpResponseRedirect('/events/invite/')
          else:
              messages.add_message(request, messages.ERROR, 'Error')
              context = {'form': form}
              return render_to_response('events/event_edit.html', context, context_instance=RequestContext(request))
      else:
          form = EventForm
  
      context = {'form': form}
      return render_to_response('events/event_edit.html', context, context_instance=RequestContext(request))
  </code></pre>