title: Why am I unable to assign a value to a form field on submit?
body: <p>I have a model field called nearbyzips1, and I have a list of integers called in zip_codes.  I am trying to pass the value of zip_codes[1] to nearbyzips1, but for some reason it won't save.  When I fill out the form and hit submit, I can see all the values from each field except for nearbyzips1 which returns None.    </p>
  
  <pre><code>if form.is_valid():
  
      cleanzipcode= form.cleaned_data['zipcode']
      nearestzips = PostalCode.objects.distance(PostalCode.objects.get(code=cleanzipcode).location).order_by('distance')[:8]
  
      zip_codes = list(nearestzips.values_list('code', flat=True))
      //print zip_codes
      form.cleaned_data['nearbyzips1'] = zip_codes[1]
      //print form.cleaned_data['nearbyzips1']
      profile = form.save()
  </code></pre>
  
  <p>I added some print statements to troubleshoot, and zip_codes prints a short list of integers as expected.  form.cleaned_data['nearbyzips'] returns one of those integers from the list.  So then why is it not saving?  I am very confused.</p>
  
  <p>I am suspecting the issue is in the code above, but just in case I have included some of my other code from forms.py and models.py in case it helps.</p>
  
  <p>models.py</p>
  
  <pre><code>class MyProfile(UserenaBaseProfile):
      user = models.OneToOneField(User,
                                  unique=True,
                                  verbose_name=_('user'),
                                  related_name='my_profile')
      streetaddress=models.CharField(null=True, blank=True, max_length=30)
      city = models.CharField(null=True, blank=True, max_length=20)
      state = models.CharField(null=True, blank=True, max_length=20)
      zipcode = models.IntegerField(_('zipcode'),
                                         max_length=5, null=True, blank=True)
      nearbyzips1=models.IntegerField(null=True, blank=True, max_length=10)
  </code></pre>
  
  <p>forms.py</p>
  
  <pre><code>class EditProfileForm(forms.ModelForm):
      """ Base form used for fields that are always required """
      first_name = forms.CharField(label=_(u'First name'),
                                   max_length=30,
                                   required=False)
      last_name = forms.CharField(label=_(u'Last name'),
                                  max_length=30,
                                  required=False)
  
      def __init__(self, *args, **kw):
          super(EditProfileForm, self).__init__(*args, **kw)
          # Put the first and last name at the top
          new_order = self.fields.keyOrder[:-2]
          new_order.insert(0, 'first_name')
          new_order.insert(1, 'last_name')
          self.fields.keyOrder = new_order
  
      class Meta:
          model = get_profile_model()
          exclude = ['user', 'privacy']
          widgets = {
              'deliveryoption': forms.RadioSelect(choices=[
              (True, '  Yes'),
              (False, '  No')             
          ])}
  
  
      def save(self, force_insert=False, force_update=False, commit=True):
          profile = super(EditProfileForm, self).save(commit=commit)
          # Save first and last name
          user = profile.user
          user.first_name = self.cleaned_data['first_name']
          user.last_name = self.cleaned_data['last_name']
  
          user.save()
  
          return profile
  </code></pre>
  
  <p>Should I maybe try pass the value to nearbyzips1 from inside the forms.py rather than the views.py?</p>