mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-28 03:33:43 +03:00
Uppercase and lowercase string enums behaviour updated.
This commit is contained in:
parent
ebdadb3aee
commit
c4ab81ebe1
|
@ -468,7 +468,10 @@ class BaseEnumField(Field):
|
|||
return value
|
||||
try:
|
||||
if isinstance(value, str):
|
||||
return self.enum_cls[value]
|
||||
try:
|
||||
return self.enum_cls[value]
|
||||
except Exception:
|
||||
return self.enum_cls(value)
|
||||
if isinstance(value, bytes):
|
||||
return self.enum_cls[value.decode('UTF-8')]
|
||||
if isinstance(value, int):
|
||||
|
@ -665,4 +668,3 @@ class LowCardinalityField(Field):
|
|||
|
||||
# Expose only relevant classes in import *
|
||||
__all__ = get_subclass_names(locals(), Field)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user