forked from Github-Mirrors/canaille
refactor: locally store the model names in lowercase
This commit is contained in:
parent
f06f0c4e25
commit
e02b54f327
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue