Skip to content

Field.widget is Widget | type[Widget] #295

@tylerlaprade

Description

@tylerlaprade

field.widget used to be Any in version 0.19.1, so code like widget.choices worked just fine, although it wasn't typed. Now that widget has a specific type of Widget | type[Widget], all our code involving widgets is full of errors since type[Widget] doesn't have attributes on it. Is this an oversight, or is there some reason widget could be a type? If so, what's the best way to work with widgets in our code with type-checking? Right now, we're blocked from upgrading to 0.20.0 as a result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions