Skip to content

Commit

Permalink
Restore value_from_datadict to widget so values don't get destroyed b…
Browse files Browse the repository at this point in the history
…y commas (#104)
  • Loading branch information
chellman committed Jun 18, 2024
1 parent 059be98 commit eb4a2f5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dynamic_raw_id/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit eb4a2f5

Please sign in to comment.