title: How can I call a clean method before get_or_create saves to the database?
body: <p>I've got a model in Django in which some data is frequently invalid. Usually I call a <code>clean()</code> method that I've written to deal with these situations, however, <code>get_or_create()</code> seems to call <code>save()</code> before I get a chance to call <code>clean()</code>.</p>
  
  <p>How can clean my data before <code>get_or_create()</code> attempts to write to the database?</p>
  
  <p>Here's the relevant parts of my model:</p>
  
  <pre><code>class Article(models.Model):
      optional_attribute = models.CharField(max_length = 250)
  
      def clean(self):
          if not self.optional_attribute:
              self.optional_attribute = 'Default'
  </code></pre>