def set(self, name, default=<NUM_LIT:0>, editable=True, description="<STR_LIT>"):
var, created = ConfigurationVariable.objects.get_or_create(name=name)<EOL>if created:<EOL><INDENT>var.value = default<EOL><DEDENT>if not editable:<EOL><INDENT>var.value = default<EOL><DEDENT>var.editable = editable<EOL>var.description = description<EOL>var.save(reload=False)<EOL>self.ATTRIBUTES[var.name] = var.value<EOL>
Define a variable in DB and in memory