title: can you use python random module inside django models to create unique id
body: <p>i'm building an invoicing web app, so I want to be able to create a unique id of every invoice but also I want to control how the id looks eg &quot;&quot;,BU236718N</p>
  <pre><code>from random import randint, choice
  from django.db import models
  
  def myID():
      my_id = &quot;BU&quot; + randint(1,100000) + choice(&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;)
      return(my_id)
  
  class Invoice(models.Model):
      invoice_number = models.CharField(myID)
  
     def __str__(self):
          return (self.invoice_number)
  
  
  </code></pre>