Comparing version 0.1.14-alpha.1 to 0.1.14-alpha.2
@@ -68,3 +68,3 @@ const { And } = require('./And') | ||
getModelFields (model, prefix) { | ||
getModelFields (model, prefix, alias) { | ||
const selection = [] | ||
@@ -79,13 +79,14 @@ const joins = [] | ||
for (const f of fieldNames) { | ||
last.columns.push(prefix ? `${prefix}__${f}` : f) | ||
last.columns.push(f) | ||
} | ||
} else { | ||
if (obj !== model) { | ||
const joinAlias = alias ? `${alias}_${obj.table}` : obj.table | ||
joins.push( | ||
new QueryJoin({ | ||
name: obj.table, | ||
alias: obj.table, | ||
alias: joinAlias, | ||
conditions: { | ||
[model.pkName]: new QueryColumn({ | ||
source: obj.table, | ||
source: joinAlias, | ||
name: obj.pkName | ||
@@ -101,3 +102,3 @@ }) | ||
prefix, | ||
source: obj.table | ||
source: alias || obj.table | ||
}) | ||
@@ -104,0 +105,0 @@ ) |
@@ -41,3 +41,7 @@ const { And } = require('./And') | ||
const TargetModel = getModel(field.model) | ||
const [selection, joins] = this.getModelFields(TargetModel, relationName) | ||
const [selection, joins] = this.getModelFields( | ||
TargetModel, | ||
relationName, | ||
relationName | ||
) | ||
return aggr | ||
@@ -44,0 +48,0 @@ .join({ |
{ | ||
"name": "djorm", | ||
"version": "0.1.14-alpha.1", | ||
"version": "0.1.14-alpha.2", | ||
"description": "Django like ORM framework", | ||
@@ -39,3 +39,3 @@ "author": "Pavel Žák <pavel@zak.global>", | ||
}, | ||
"gitHead": "84efba14ec3856951576d980b404ec1fa78d2eb3" | ||
"gitHead": "b74dd4a8f13441f3e5f0bb4a68a52ed6f9c68060" | ||
} |
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
84480
2932