title: update in django with image field
body: <p>I am trying to use django orm to update image field only i.e user will later add image and will be updated in primary table</p>
  
  <p>i tried </p>
  
  <pre><code>MerchantProfile.objects.filter(id='%s'%(cd['id'])).update(photo='%s'%(cd['photo']))
  </code></pre>
  
  <p>but it will update the caption only and image in not saved in folder</p>
  
  <p>Then i tried following</p>
  
  <pre><code>p1=MerchantProfile()
  p1.id=cd['id']
  if cd['photo']:
         p1.photo=cd['photo']
  else:
         p1.photo=cd['uploaded_photo']
  p1.save()
  </code></pre>
  
  <p>It will save the image but will show error like <code>payment_card</code> cannot be <code>null</code></p>
  
  <p>My models is as below</p>
  
  <pre><code>class Merchantprofile:
     user = models.OneToOneField(UserProfile, related_name="merchant_profile")
     payment_card = models.OneToOneField(PaymentCard, related_name="merchant_profile")
     current_state = models.IntegerField('State', choices=STATE_CHOICES)
     name = models.CharField('Merchant Name', max_length=64)
     photo=models.ImageField(upload_to='logo',blank=True)
  </code></pre>
  
  <p>form</p>
  
  <pre><code>class LogoForm(forms.Form):
       id = forms.CharField(widget=forms.HiddenInput,required=False)
       photo = forms.ImageField(
          required=False,
          label='Upload photo',
          initial=True,
          help_text='max. 4 megabytes'
      )
  </code></pre>
  
  <p>so what is the best way to update photo field only with uploading photo on relevant folder, as i cannot update all field everytime   </p>