You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the variable ranks = ({'name': 'abc', 'score': 3.4},). The score gets converted into a string by django-unicorn even though it is a float. Type hints like tuple[dict[str, str|float]] or even tuple[dict[str, float] do not have an effect.
class SortTableView(UnicornView):
ranks: tuple[dict[str,float|str]] = ()
def mount(self):
self.ranks = ({'name': 'abc', 'score': 3.4},)
def button_click(self):
self.ranks = tuple(sorted(self.rank, key=lambda row: row['score'])
# wrong sort order here because the score is a string not a float
The text was updated successfully, but these errors were encountered:
I have the variable
ranks = ({'name': 'abc', 'score': 3.4},)
. Thescore
gets converted into a string by django-unicorn even though it is a float. Type hints liketuple[dict[str, str|float]]
or eventuple[dict[str, float]
do not have an effect.(Background seems to be described here: #82)
A minimal example would look like this:
The text was updated successfully, but these errors were encountered: