It seems that I must pass in a dummy value to the list when it is
created, like
var m = new Message({
...
comments = ["none"]
...
});
then .push() works if you're pushing a string. But the property is
defined as
var Message = exports.Message = db.Model('Message',{
...
comments: new db.ListProperty(Comment)
...
});
and when I try to pass in a Comment object I get:
JavaException: java.lang.IllegalArgumentException: comments:
org.mozilla.javascript.NativeObject is not a supported property type.
(google/appengine/ext/db/model.js#245)
With my CustomUser object, which has a .friendlist of CustomUser
objects, I had to pass in the .userid for the CustomUser, and the
userids are stored in the list, since passing a CustomUser object
produced the same Java exception. Perhaps I should create a similar
property for my Comment object?
Pete