Replies: 1 comment
-
FYI: the current workaround I did implement was to have a function to patch the registry at runtime; something like this import schwifty.registry
_CUSTOM_REGISTRY = [
{
"country_code": "ABC",
"primary": True,
"bic": "MYBIC",
"bank_code": "9000",
"name": "mybank",
"short_name": "mybank",
}
]
def patch_schwifty_registry() -> None:
"""
Patch the schwifty registry at runtime.
"""
# get the previous registry and update
old = schwifty.registry.get("bank")
old.extend(_CUSTOM_REGISTRY)
schwifty.registry.save("bank", old)
# rebuild indices
schwifty.registry.build_index("bank", "country", key="country_code", accumulate=True)
schwifty.registry.build_index("bank", index_name="bic", key="bic", accumulate=True)
schwifty.registry.build_index(
"bank",
index_name="bank_code",
key=("country_code", "bank_code"),
accumulate=True,
) In something like django, you could load this patch functionality from an |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have a use case where we would like to use our some form of fake IBANs, matched to a fake BIC.
Would it be an option to have some functionality to override / extend the built-in registry?
I can see some clear reason why you would not like to do this sort of thing (it'd be a potential security issue). Our use case though now forces us to wrap the library instead, which is a bit unfortunate, which is why I would still like to bring up to idea of an editable registry.
Beta Was this translation helpful? Give feedback.
All reactions