I have a model named Customers. I want the admin to be able to add the details of each customer through admin panel. The details include username, password, company, email, etc. For password, I want to generate an auto randomly generated password field(not to be typed in admin forms), which can't be seen by admin and will be sent to the customer. I am new to Django and I can't figure out a way to do that.
EDIT
Here is the code I wrote in models.py.
class Customer(AbstractBaseUser):
def generate_password():
#code to generate password
return password
customer_name = models.CharField(max_length=50)
password = generate_password()
But I am getting same password for every customer.