How to use variables in django models.py, (DEFAULT properties of fields)
I would like that, when clicking on one of the companies below, a variable is stored (until the browser is closed) with the company's code.
And, I need this variable to populate the 'CompanyCode' fields as default value.
class Employee(models.Model): class Meta: db_table = 'employee' CompanyCode= models.IntegerField( null=False, blank=None, default = 'VARIABLE', db_column='CompanyCode' )
After being stored in the database, I need to make a query to show all tuples where CompanyCode is equal to a certain value.