title: Django model fields unique=True and default=function
body: <p>So I have a model that looks like this</p>
  
  <pre><code>def create_invite_code():
    return str(uuid.uuid4())[0:8]
  
  class InviteCodes(models.Model): 
    id = models.CharField(max_length = 36, primary_key = True, default=build_uuid)      
    code = models.CharField(max_length=8, unique=True, default=create_invite_code)
  </code></pre>
  
  <p>What happens if create_invite_code returns a code that already exists in the db, will django call the function again until it finds one that doesn't exist? Or will it error out?</p>