add Model metaclass to collect model accessor methods from backend classes
This commit is contained in:
parent
60bba47624
commit
76a6a86eac
2 changed files with 28 additions and 1 deletions
|
|
@ -25,3 +25,10 @@ BACKENDS = {
|
|||
'sts': sts_backend,
|
||||
'route53': route53_backend
|
||||
}
|
||||
|
||||
|
||||
def get_model(name):
|
||||
for backend in BACKENDS.values():
|
||||
models = getattr(backend.__class__, '__models__', {})
|
||||
if name in models:
|
||||
return getattr(backend, models[name])()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue