Apply literal contains filters consistently to numeric and textual fields
This commit is contained in:
parent
ff989fd6ee
commit
c5bf7d4a7d
1 changed files with 96 additions and 10 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import builtins
|
||||
from typing import Union
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
|
@ -9,3 +10,9 @@ class Filter(BaseModel):
|
|||
property: str
|
||||
operator: Operator
|
||||
value: Union[float, str]
|
||||
|
||||
@builtins.property
|
||||
def value_as_text(self) -> str:
|
||||
if isinstance(self.value, float) and self.value.is_integer():
|
||||
return str(int(self.value))
|
||||
return str(self.value)
|
||||
|
|
|
|||
Loading…
Reference in a new issue