# HG changeset patch # User veltr # Date 1346250907 -7200 # Node ID 95a1e550e5b17be2a87de04728ef3fccea93c384 # Parent 805d85b3f390431bca74b3bba290634b325e0797# Parent 6ec62ab8cb8de4faa2d8133bce96448dbfd83ae1 Merge with 6ec62ab8cb8de4faa2d8133bce96448dbfd83ae1 diff -r 805d85b3f390 -r 95a1e550e5b1 client/js/models.js --- a/client/js/models.js Tue Aug 28 18:26:13 2012 +0200 +++ b/client/js/models.js Wed Aug 29 16:35:07 2012 +0200 @@ -21,7 +21,7 @@ constructor: function(options) { if (typeof options !== "undefined") { - options._id = options.id || Models.getUID(this); + options._id = options._id || options.id || Models.getUID(this); options.title = options.title || "(untitled " + this.type + ")"; options.description = options.description || ""; options.uri = options.uri || ""; @@ -57,12 +57,12 @@ }, toJSON: function() { return { - id: this.get("id"), + _id: this.get("_id"), title: this.get("title"), uri: this.get("uri"), description: this.get("description"), color: this.get("color"), - } + }; }, }); @@ -82,13 +82,13 @@ }, toJSON: function() { return { - id: this.get("id"), + _id: this.get("_id"), title: this.get("title"), uri: this.get("uri"), description: this.get("description"), position: this.get("position"), - created_by: this.get("created_by").get("id") - } + created_by: this.get("created_by").get("_id") + }; }, }); @@ -121,14 +121,14 @@ }, toJSON: function() { return { - id: this.get("id"), + _id: this.get("_id"), title: this.get("title"), uri: this.get("uri"), description: this.get("description"), - from: this.get("from").get("id"), - to: this.get("to").get("id"), - created_by: this.get("created_by").get("id"), - } + from: this.get("from").get("_id"), + to: this.get("to").get("_id"), + created_by: this.get("created_by").get("_id"), + }; }, });