Comparing version 0.1.19-alpha.2 to 0.1.19-alpha.4
@@ -13,3 +13,4 @@ function formatObject (obj) { | ||
code: this.code, | ||
message: this.message | ||
message: this.message, | ||
originalException: this.originalException | ||
} | ||
@@ -16,0 +17,0 @@ } |
const storageHub = require('../storage/StorageHub') | ||
const { v4 } = require('uuid') | ||
const { AttrModel, Field } = require('../models/AttrModel') | ||
const { basename } = require('path') | ||
const { AttrModel, Field } = require('../models/AttrModel') | ||
const { BooleanField } = require('./BooleanField') | ||
const { createReadStream } = require('fs') | ||
@@ -10,2 +10,3 @@ const { CharField } = require('./CharField') | ||
const { pipeline } = require('stream') | ||
const { v4 } = require('uuid') | ||
@@ -17,2 +18,3 @@ class File extends AttrModel { | ||
static src = new Field() | ||
static stored = new BooleanField({ default: false }) | ||
@@ -85,2 +87,8 @@ static meta = { | ||
fromDb (value, inst) { | ||
value = super.fromDb(value, inst) | ||
value.set('stored', true) | ||
return value | ||
} | ||
toDb (value) { | ||
@@ -101,3 +109,3 @@ if (value) { | ||
async saveFileValue (inst, fieldName, value) { | ||
if (value) { | ||
if (value && !value.stored) { | ||
await value.save() | ||
@@ -104,0 +112,0 @@ } |
{ | ||
"name": "djorm", | ||
"version": "0.1.19-alpha.2", | ||
"version": "0.1.19-alpha.4", | ||
"description": "Django like ORM framework", | ||
@@ -44,3 +44,3 @@ "author": "Pavel Žák <pavel@zak.global>", | ||
}, | ||
"gitHead": "380e5b3b2201e9f36f148499d93c4ea1723ec1b7" | ||
"gitHead": "f6cf9f13897857d12f0b8801afa7da17e2fc1df6" | ||
} |
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
91560
3156