refactor: locally store the model names in lowercase

This commit is contained in:
Éloi Rivard 2024-04-06 18:21:50 +02:00
parent f06f0c4e25
commit e02b54f327
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184

View file

@ -2,9 +2,9 @@ MODELS = {}
def __getattr__(name):
if name in MODELS:
return MODELS[name]
if name.lower() in MODELS:
return MODELS[name.lower()]
def register(model):
MODELS[model.__name__] = model
MODELS[model.__name__.lower()] = model