Skip to content

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

Description

@nonprofittechy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions