appengine_js icon indicating copy to clipboard operation
appengine_js copied to clipboard

toJSON() fails on toData() when have a ReferenceProperty (Datastore api)

Open leite opened this issue 15 years ago • 0 comments

here is the patch ...

\lib\google\appengine\ext\db\model.js line: 357 /* */ Model.prototype.toData = function () { var data = { key: this.key().toString() } var properties = this.constructor.properties(); // for (var i in properties) { var prop = properties[i];

    if( typeof(this[prop.name])=='object' ){
        data[prop.name] = this[prop.name].toData();
    }else{
        data[prop.name] = this[prop.name];
    }

}
return data;

} /**/

leite avatar Dec 29 '10 15:12 leite