Skip to content

Single-value tag widgets #118

Closed
Closed

Description

@lgimberis

Hi, firstly thanks for your work on this project. It's exactly what I was looking for.

I'm currently trying to implement a select2 field that allows the end user to either select an existing value OR enter a 'new' value, which will automatically create the related object. It seems that the ModelSelect2TagWidget was made for exactly this purpose.
However, this widget inherently allows selecting multiple items at once. In the context where I'm using it, this isn't appropriate and the user should only be able to enter a single value.

Is there a straightforward way to configure a ModelSelect2TagWidget to only select a single item, or ModelSelect2Widget to allow 'tagging'/submission of items that don't yet exist?
To clarify, something more like the first example on this page, currently it's the second.
Right now, the best way I can see to achieve this would be to make a custom set of widgets parallel to the existing tag widgets but without the multiple mixin - is there a simpler way?

Thanks.

Activity

  1. Repository owner locked and limited conversation to collaborators on Mar 11, 2022
  2. converted this issue into a discussion #126 on Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions