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

Restore value_from_datadict to widget so values don't get destroyed by commas #104

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions dynamic_raw_id/widgets.py
Original file line number Diff line number Diff line change
@@ -48,6 +48,17 @@ def media(self) -> forms.Media:


class DynamicRawIDMultiIdWidget(DynamicRawIDWidget):
def value_from_datadict(
self,
data: dict[str, Any],
files: Any | None,
name: str,
) -> str | None:
value = data.get(name)
if value:
return value.split(",")
return None

def render(
self,
name: str,