
Nov. 4, 2023
1:13 a.m.
A little late, but the requirement to "Extract variable name from itself" is widely used in Django. Each field in a Django model, knows it's own variable name user_name = models.CharField(...) The instance of CharField knows that it's variable name is "user_name", so that it can name the row in the database the same. On startup Django runs through the Model class searching for instances of Field and gets the name that way