File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ def from_value(cls, value: Any) -> Field:
4242 return cls (stringValue = str (value ))
4343 elif type (value ).__name__ .endswith ('PGobject' ):
4444 return cls (stringValue = str (value ))
45+ elif type (value ).__name__ .endswith ('BigInteger' ):
46+ return cls (longValue = int (str (value )))
4547 else :
4648 raise Exception (f'unsupported type { type (value )} : { value } ' )
4749
Original file line number Diff line number Diff line change @@ -70,6 +70,15 @@ def __str__(self) -> str:
7070
7171 assert Field .from_value (PGobject ("{}" )) == Field (stringValue = "{}" )
7272
73+ class BigInteger :
74+ def __init__ (self , val : int ):
75+ self ._val : int = val
76+
77+ def __str__ (self ) -> int :
78+ return self ._val
79+
80+ assert Field .from_value (BigInteger ("55" )) == Field (longValue = 55 )
81+
7382 class Dummy :
7483 pass
7584
You can’t perform that action at this time.
0 commit comments