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

Custom Format objects #245

Open
rsundqvist opened this issue Apr 17, 2024 · 1 comment
Open

Custom Format objects #245

rsundqvist opened this issue Apr 17, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@rsundqvist
Copy link
Owner

rsundqvist commented Apr 17, 2024

Let users pass a callable (derive placeholders based on what has defaults?). How to distinguish from old-style formats in config?

E.g.

def my_format(id, name, is_nice=None) -> str:
    s = f"{id}:{name}"
    if is_nice is not None:
        s += f":{is_nice}"
    return s

Would be equivalent to Format("{id}:{name}[:{is_nice}]").

@rsundqvist rsundqvist added the enhancement New feature or request label Apr 17, 2024
@rsundqvist
Copy link
Owner Author

Effect on complex formats (implicit joins with other tables)?

https://github.com/rsundqvist/id-translation/blob/master/tests/dvdrental/test_complex_format.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant