title: Django random value for Model field
body: <p>So I am able to generate a random id using uuid
  So far so good
  But when I try to database i get same value</p>
  
  <pre><code> def f():
      d = uuid4()
      str = d.hex
      return str[0:16]
  </code></pre>
  
  <hr>
  
  <pre><code>class Q(models.Model):
    a = models.CharField(max_length=150)
    b = models.IntegerField(max_length=25)
    c = models.IntegerField(max_length=32 , default=0)
    d = models.ManyToManyField(Ans , related_name='aa')
    e = models.CharField(max_length=18 , default = f() ,unique=True )
  
  
  class Ans(models.Model):
    sub = models.CharField(max_length=150) 
  
  
  -----------------------------------------------------------------
  </code></pre>
  
  <p>And I'm inserting like this</p>
  
  <pre><code>def ins(request):
       t =random.randint(0, 1000)
       p = Q(a = t , b=0 , c=0)
       p.save()
       return HttpResponse('Saved')
  </code></pre>
  
  <p>Just curious what the hell is happening here</p>
  
  <p>Side note: If I set <code>e.unique = False</code> I get 2-3 with the same e values before I get a new
  UUID values</p>