title: Whats the most Django/pythonic way to create or overwrite a record?
body: <p>Working with Django 1.2 I am making a wine review site. A user should only be able to review each wine once, but should be able to go back and re-review a wine without raising an error.</p>
  
  <p>Using the get_or_create method seems the most rational solution but I have been running into various problems implementing it. Searching I found this article which looked promising:
  <a href="https://stackoverflow.com/questions/1941212/correct-way-to-use-get-or-create">Correct way to use get_or_create?</a></p>
  
  <p>and of course the django documentation on it:
  <a href="http://docs.djangoproject.com/en/1.2/ref/models/querysets/#get-or-create" rel="nofollow noreferrer">http://docs.djangoproject.com/en/1.2/ref/models/querysets/#get-or-create</a></p>
  
  <p>But didn't seem to answer my question. Here is my code:</p>
  
  <p><strong>Views.py</strong> </p>
  
  <pre><code>@login_required
  def wine_review_page(request, wine_id):
  wine = get_object_or_404(Wine, pk=wine_id)
  
  if request.method == 'POST':
  form = WineReviewForm(request.POST)
  if form.is_valid():
    review, created = Review.objects.get_or_create(
      user = request.user,
      wine = wine,
      like_dislike = form.cleaned_data['like_dislike'],
      ...
      )
  variables = RequestContext(request, {
   'wine': wine
    })   
    review.save()
    return HttpResponseRedirect(
      '/detail/%s/' % wine_id
    )
  else:
    form = WineReviewForm()
    variables = RequestContext(request, {
    'form': form,
    'wine': wine
   })
  return render_to_response('wine_review_page.html', variables)
  </code></pre>
  
  <p><strong>Models.py</strong></p>
  
  <pre><code>class Review(models.Model):
    wine = models.ForeignKey(Wine, unique=True)
    user = models.ForeignKey(User, unique=True)
    like_dislike = models.CharField(max_length=7, unique=True)
    ...
  </code></pre>
  
  <p>If I understand how to use get_or_create correctly, since I am not matching on all the values like_dislike, etc... then django perceives it to be unique. I tried removing the other form parameters, but then they are not submitted with the post request. </p>
  
  <p>Suggestions would be greatly appreciated. </p>