summaryrefslogtreecommitdiffstats
path: root/web/js/labitrack.d/35-object.js
blob: ae4389578da59c10fdf4b67dc7c1fcdf323611fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(function(){
	var object = λ.o = Backbone.Model.extend({
		defaults: {
			name: 'Name',
			desc: 'Description',
			tags: []
		},
		url: function(){
			var base = '/o';
			if (this.isNew()) return base;
			return base + '/' + this.id + '.json';
		}
	});

	object.get = function(id, opts){
		var o = new object({id: id});
		o.fetch(opts);
		return o;
	};
}());