Jay Young
unread,Sep 11, 2010, 11:18:00 PM9/11/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to appenginejs
I have a simple db.Model with just a few simple properites. One of
them is flagged with {required: true}, but if I create an instance and
put() it, no error is thrown and the entity appears in the datastore
without the required property:
var Response = require('nitro/response').Response;
var db = require('google/appengine/ext/db');
exports.GET = function(req) {
var TestModel = db.Model('TestModel', {
modelID: new db.StringProperty({required: true}),
modelName: new db.StringProperty({required: true})
});
var test = new TestModel();
test.put();
return Response.ok();
};
Running this throws no error and puts the entity into the data store.
Is that working correctly? If it is, how do I enforce that a property
be required?
Thanks.