Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows configurable mapping from AS data to Aeon Request fields #244

Draft
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

helrond
Copy link
Member

@helrond helrond commented Sep 20, 2022

Proof of concept to demonstrate a possible approach to providing configurable mappings from AS to Aeon data. The key piece is these lines, which takes a string representing either a callable in helpers.py or a key (using dot notation):

for k, callable_or_key in mappings.AEON.items():
try:
value = getattr(helpers, callable_or_key)(i, client)
except AttributeError:
proxy = Cut(i)
value = proxy.get(callable_or_key)
parsed[f"{k}_{request_prefix}"] = value

If this approach seems promising, I'll need to do additional work to clean up the code, update tests, and possibly do some refactoring of existing helpers to improve performance. I'd also suggest building on the work in #243 and using the Django Admin UI for managing configs, rather than the mappings.py file I've provided here.

@helrond helrond marked this pull request as draft September 20, 2022 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant