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

Add a function to limit a list of objects to a specific character limit. E.g., a list of people, addresses, etc that go onto a single text box #259

Open
nonprofittechy opened this issue Jun 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@nonprofittechy
Copy link
Member

Something like:

safe_displayed_items(list, character_length, function_to_use=comma_and_list, map=str) => List[Any]

so you could customize the way the list is displayed, but default to comma_and_list like DAList already does. And then you would assume each item is displayed with str() but in some cases they might want to print the items a different way, like with on_one_line().

To decide: is this best for it to return a list of items, or the text representation of the list? presumably, if it preserves the datatype of the list (e.g., a DAList) it should be fine to return the truncated list.

For inspiration, see: SuffolkLITLab/docassemble-AssemblyLine#863

@nonprofittechy nonprofittechy added the enhancement New feature or request label Jun 17, 2024
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