title: Django form geocoding - where to geocode, how to validate, how to pass geocode result
body: <p>I have a very simple Django form which consists of a single field - "address":</p>
  
  <pre><code>class AddressSearchForm(forms.Form):
      """
          A form that allows a user to enter an address to be geocoded
      """
      address = forms.CharField()
  </code></pre>
  
  <p>I probably do not even need to use a form, since I'm not saving this data - I'm just collecting it to use in a search. But, I want to perform validation:</p>
  
  <pre><code>def clean_address():
      data = self.cleaned_data
      g = geocoders.Google()
      try:
          place, (lat,lng) = g.geocode(data['address'])
      except (GQueryError):
          raise forms.ValidationError('Please enter a valid address')
      except (GeocoderResultError, GBadKeyError, GTooManyQueriesError):
          raise forms.ValidationError('There was an error geocoding your address. Please      try again')
      except:
          raise forms.ValidationError('An unknown error occured. Please try again')
  </code></pre>
  
  <p>In addition, I want to use this geocoded result to pass a Point object to my view:</p>
  
  <pre><code>from django.contrib.gis.geos import Point
  point = Point(lng, lat)
  </code></pre>
  
  <p>My question is, how to pass both the address and the point data to my view? I could just pass the address and then re-geocode in the view, but that would be duplicating code. So, how to pass the point object from the form? Should I use a hidden field? Other suggestions? Thanks in advance.</p>