Comparing version 0.1.16-alpha.3 to 0.1.16-alpha.4
@@ -102,3 +102,3 @@ const { DatabaseModelBase } = require('./DatabaseModelBase') | ||
*/ | ||
getFieldTarget (fieldPath) { | ||
getFieldTarget (fieldPath, value) { | ||
const separatorIndex = fieldPath.indexOf(FIELD_SEPARATOR) | ||
@@ -108,2 +108,5 @@ if (separatorIndex === -1) { | ||
} | ||
if (value === null) { | ||
return null | ||
} | ||
const localFieldName = fieldPath.substr(0, separatorIndex) | ||
@@ -127,7 +130,10 @@ const field = this.constructor.getField(localFieldName) | ||
try { | ||
const [inst, field, fieldName] = this.getFieldTarget(fieldPath) | ||
inst[fieldName] = field.fromDb( | ||
this.constructor.db.parseValue(field, value), | ||
inst | ||
) | ||
const target = this.getFieldTarget(fieldPath, value) | ||
if (target) { | ||
const [inst, field, fieldName] = target | ||
inst[fieldName] = field.fromDb( | ||
this.constructor.db.parseValue(field, value), | ||
inst | ||
) | ||
} | ||
} catch (e) { | ||
@@ -134,0 +140,0 @@ if (e instanceof FieldError) { |
{ | ||
"name": "djorm", | ||
"version": "0.1.16-alpha.3", | ||
"version": "0.1.16-alpha.4", | ||
"description": "Django like ORM framework", | ||
@@ -39,3 +39,3 @@ "author": "Pavel Žák <pavel@zak.global>", | ||
}, | ||
"gitHead": "74a35dd37a5973bad537ae0bd3c6064e31151aab" | ||
"gitHead": "587877d4f462247cb6d0cc13c69bf26795884855" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86075
2986