Comparing version 0.1.18-alpha.0 to 0.1.18-alpha.1
@@ -39,2 +39,6 @@ const { AttrModel, Field } = require('../models/AttrModel') | ||
static meta = { | ||
modelName: 'File' | ||
} | ||
get filePath () { | ||
@@ -71,4 +75,4 @@ return [this.get('basePath'), this.get('name')].join('/') | ||
static basePath = new CharField() | ||
static model = new ObjectField({ default: File, model: File }) | ||
static storage = new ObjectField({ model: FileStorage }) | ||
static model = new ObjectField({ default: () => File, model: Object }) | ||
static storage = new ObjectField({ model: FileStorage, null: true }) | ||
static defaultStorage = new ObjectField({ | ||
@@ -87,7 +91,7 @@ default: getSystemDefaultStorage, | ||
static basePathField = new Field() | ||
static storageField = new Field() | ||
static storageField = new Field({ null: true }) | ||
parse (value, inst) { | ||
return this.model.from({ | ||
storage: this.resolveStorage(inst), | ||
return this.get('model').from({ | ||
storage: this.resolveStorage(this), | ||
basePath: getFieldValue(inst, this.basePathField) || this.get('basePath'), | ||
@@ -94,0 +98,0 @@ name: getFieldValue(inst, this.nameField) |
@@ -10,2 +10,3 @@ const { Field } = require('../models/AttrModel') | ||
...require('./DateTimeField'), | ||
...require('./EmailField'), | ||
...require('./FileField'), | ||
@@ -12,0 +13,0 @@ ...require('./FloatField'), |
{ | ||
"name": "djorm", | ||
"version": "0.1.18-alpha.0", | ||
"version": "0.1.18-alpha.1", | ||
"description": "Django like ORM framework", | ||
@@ -42,3 +42,3 @@ "author": "Pavel Žák <pavel@zak.global>", | ||
}, | ||
"gitHead": "2abd6e06437504b23c9cbb6177746ffbcbdb2d46" | ||
"gitHead": "f3a01cf12213650617ae9a2c554776d9cb6a38d5" | ||
} |
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
87829
78
3053