8000 MultipleSelect2HiddenInput returns bad has_changed value · Issue #45 · applegrew/django-select2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
MultipleSelect2HiddenInput returns bad has_changed value #45
Closed
@mociepka

Description

@mociepka

MultipleSelect2HiddenInput extends forms.TextInput that widget gets his _has_changed from Widget class: https://github.com/django/django/blob/stable/1.5.x/django/forms/widgets.py#L211.

That function is not good for many value widgets because for initial values: None, [] it returns True...

You have to use _has_changed from: https://github.com/django/django/blob/stable/1.5.x/django/forms/widgets.py#L642.

This problem occurred when I try use that field in formset. Formset validates only changed forms, so now it will validate all forms in formset even extra ones.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0