title: How do I update an object's members using a dict?
body: <p>I'm writing a Django app that performs various functions, including inserting, or updating new records into the database via the URL.</p>
  
  <p>So some internal application sends off a request to <code>/import/?a=1&amp;b=2&amp;c=3</code>, for example.
  In the view, I want to create a new object, <code>foo = Foo()</code> and have the members of <code>foo</code> set to the data in the request.GET dictionary.</p>
  
  <p>Here is what I'm doing now:</p>
  
  <ol>
  <li>Request sent to <code>/import/?a=1&amp;b=2&amp;c=3</code></li>
  <li>View creates new object: <code>foo = Foo()</code></li>
  <li>Object is updated with data.</li>
  </ol>
  
  <p>Here is what I got thus far:</p>
  
  <pre><code>foo.a = request['a']
  foo.b = request['b']
  foo.c = request['c']
  </code></pre>
  
  <p>Obviously this is tedious and error prone. The data in the URL has the exact same name as the object's members so it is a simple 1-to-1 mapping. </p>
  
  <p>Ideally, I would like to do able to do something like this:</p>
  
  <pre><code>foo = Foo()
  foo.update(request.GET)
  </code></pre>
  
  <p>or something to that effect.</p>
  
  <p>Thanks!</p>