Example #1
0
def get_signature_backend(code, *args, **kwargs):
    """Instantiate instance for ``backend_code`` with ``args`` and ``kwargs``.

    Get the backend factory (class) using ``settings.ANYSIGN['BACKENDS']``.

    Positional and keyword arguments are proxied as is.

    """
    factory_path = settings.ANYSIGN['BACKENDS'][code]
    factory = import_member(factory_path)
    return factory(*args, **kwargs)
Example #2
0
def get_model(setting):
    """Import and return the model class by ``settings.ANYSIGN[{setting}]``."""
    model_path = settings.ANYSIGN[setting]
    model = import_member(model_path)
    return model