How to set the field default value of another model in django based on the field value of another model

one of my model has a field value that needs a default value, such as

class Earnings(models.Model):
    earing_num=models.DecimalField(default=)

but the setting of the default value depends on a field value of another model

class Product(models.Model):
    earning_type=models.CharField()

if earning_type is A, the default value is 1
if earning_type _ type is B, the default value is 2

how to achieve

Mar.03,2021

redefine objects and then rewrite the create method

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b32ecb-403de.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b32ecb-403de.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?