mirror of
https://github.com/carrotquest/django-clickhouse.git
synced 2024-11-28 20:13:45 +03:00
Bugfix
This commit is contained in:
parent
5add74cc39
commit
e1d7db1525
|
@ -16,10 +16,13 @@ class Django2ClickHouseModelSerializer:
|
||||||
data = model_to_dict(obj, self.serialize_fields, self.exclude_serialize_fields)
|
data = model_to_dict(obj, self.serialize_fields, self.exclude_serialize_fields)
|
||||||
|
|
||||||
# Remove None values, they should be initialized as defaults
|
# Remove None values, they should be initialized as defaults
|
||||||
|
params = {}
|
||||||
for key, value in data.items():
|
for key, value in data.items():
|
||||||
if value is None:
|
if value is None:
|
||||||
del data[key]
|
pass
|
||||||
elif isinstance(value, bool):
|
elif isinstance(value, bool):
|
||||||
data[key] = int(value)
|
params[key] = int(value)
|
||||||
|
else:
|
||||||
|
params[key] = value
|
||||||
|
|
||||||
return self._model_cls(**data)
|
return self._model_cls(**params)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user