File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ def from_value(cls, value: Any) -> Field:
4747 return cls (stringValue = str (value ))
4848 elif type (value ).__name__ .endswith ('BigInteger' ):
4949 return cls (longValue = int (str (value )))
50+ elif type (value ).__name__ .endswith ('PgArray' ):
51+ return cls (stringValue = str (value ))
5052 else :
5153 raise Exception (f'unsupported type { type (value )} : { value } ' )
5254
Original file line number Diff line number Diff line change @@ -84,6 +84,17 @@ def __str__(self) -> int:
8484
8585 assert Field .from_value (BigInteger ("55" )) == Field (longValue = 55 )
8686
87+ class PgArray :
88+ def __init__ (self , val : str ):
89+ self ._val : str = val
90+
91+ def __str__ (self ) -> str :
92+ return self ._val
93+
94+ assert Field .from_value (PgArray ("{ITEM1,ITEM2}" )) == Field (
95+ stringValue = "{ITEM1,ITEM2}"
96+ )
97+
8798 class Dummy :
8899 pass
89100
You can’t perform that action at this time.
0 commit comments