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

"Enter a list of values" error apparently due to value_from_datadict removal #103

Closed
chellman opened this issue Jun 17, 2024 · 4 comments
Closed

Comments

@chellman
Copy link
Contributor

chellman commented Jun 17, 2024

I'm glad to see the compatibility update, but I think something was removed that shouldn't have been.

dynamic_raw_id.widgets.DynamicRawIDMultiIdWidget.value_from_datadict doesn't exist anymore, and when I save a model with dynamic_raw_id_fields = (my_field), values like this:

33,22,11

Get transformed to this:

3,3,,2,2,,1,1

Causing an invalid list error with "Enter a list of values." displayed.

Poking around in the code, I found that restoring the missing function above, removed here, restores the expected behavior.

(Edit - PR is up.)

@bartTC
Copy link
Member

bartTC commented Jun 18, 2024

What Python and Django version do you use? This is pretty intensively tested so I'm wondering how that could come up now.

@bartTC
Copy link
Member

bartTC commented Jun 18, 2024

CleanShot 2024-06-18 at 12 02 18@2x

Nevermind, I see an issue as well.

@bartTC
Copy link
Member

bartTC commented Jun 18, 2024

v4.2 https://pypi.org/project/django-dynamic-raw-id/ has been released with your fix. Thank you for the report, investigation and provided fix.

While the widget itself is tested, its actually never checked that data is retained correctly after the save of the admin change form itself.

@bartTC bartTC closed this as completed Jun 18, 2024
@chellman
Copy link
Contributor Author

I'll use a little bit of German I know. Vielen dank, Martin! I really appreciate you taking the time on this.

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

No branches or pull requests

2 participants