title: Django CharFIeld with unique=True update error "Instance with this Name already exists"
body: <p>I'm building a Django project for a client that requires me to not user a simple <code>form.save()</code> method to update a model field.</p>
  
  <p>Basically, it looks like this:</p>
  
  <p>I have this model with a <code>CharField</code> who has <code>unique=True</code>:</p>
  
  <pre><code># models.py
  
  class Course(models.Model):
      name = models.CharField(max_length=20, unique=True)
      other_field = models.CharField(max_length=10, null=True)
  
      def __str__(self):
          return self.name
  </code></pre>
  
  <p>That model has a form in <code>forms.py</code>:</p>
  
  <pre><code># forms.py
  
  class CourseCreateForm(forms.ModelForm):
      class Meta:
          model = Course
          fields = ['name', 'other_field']
  </code></pre>
  
  <p>I need to update this field through a function view (can't be class based in this scenario. Of course, literally it can, but for my student's project requirements it can't be) and I can't use the simple <code>form.save()</code> function, so I need to do the full update code as if it was a normal form:</p>
  
  <pre><code># views.py
  
  def course_update(request, pk):
      course = Course.objects.get(pk=pk)
      course_queryset = Course.objects.filter(pk=pk)
  
  
      if request.method == "POST":
          form = CourseCreateForm(request.POST)
          if form.is_valid():
              name = form.cleaned_data['name']
              other_field = form.cleaned_data['other_field']
              course_queryset.update(name=name, other_field=other_field)  # &lt;-- Where I try to update
          else:
              print(form.errors)
          return HttpResponseRedirect('../')
      else:
          form = CourseCreateForm(instance=course)
  
          context = {
              "form": form,
          }
  
          return render(request, 'base/course_update.html', context)
  </code></pre>
  
  <p>When I try to only update the <code>other_field</code>, the change isn't made and in the formerrors I receive the error "Course with this Name already exists.", so I can't only change the <code>other_field</code> data without also having to change the <code>name</code> field because the <code>name</code> field is unique.</p>
  
  <p>How can you update a model instance's field that has unique=True without changing the unique value?</p>
  
  <p>Hope this makes sense!</p>
  
  <p>Thanks.</p>
  
  <p>UPDATE: </p>
  
  <p>Also wanted to add that it works perfectly fine when unique=True is turned off. I'm just curious how do you update a field normally when unique=True and you're adding in the same variable from a model form.</p>