mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-22 00:56:34 +03:00
Fixed ignoring of negative enum values
This commit is contained in:
parent
262ce13f4d
commit
39a812b134
|
@ -414,7 +414,7 @@ class BaseEnumField(Field):
|
||||||
import re
|
import re
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
members = {}
|
members = {}
|
||||||
for match in re.finditer("'(\w+)' = (\d+)", db_type):
|
for match in re.finditer("'(\w+)' = (-?\d+)", db_type):
|
||||||
members[match.group(1)] = int(match.group(2))
|
members[match.group(1)] = int(match.group(2))
|
||||||
enum_cls = Enum('AdHocEnum', members)
|
enum_cls = Enum('AdHocEnum', members)
|
||||||
field_class = Enum8Field if db_type.startswith('Enum8') else Enum16Field
|
field_class = Enum8Field if db_type.startswith('Enum8') else Enum16Field
|
||||||
|
|
Loading…
Reference in New Issue
Block a user