Merge branch 'develop' of https://github.com/Romamo/infi.clickhouse_orm into Romamo-develop

This commit is contained in:
Itai Shirav 2020-05-01 16:36:51 +03:00
commit bce87c40c1

View File

@ -414,7 +414,7 @@ class BaseEnumField(Field):
import re
from enum import Enum
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))
enum_cls = Enum('AdHocEnum', members)
field_class = Enum8Field if db_type.startswith('Enum8') else Enum16Field