I am using pyamf with google app engine. I am trying to exclude a property fr开发者_高级运维om the pyamf encoding. This is the syntax I am using:
class Comment(db.Model):
class __amf__:
exclude = ('article')
article = db.ReferenceProperty(Article)
comment = db.TextProperty()
This does not work on the ReferenceProperty but if I try the exclude property with the 'comment' attribute it works. I noticed that the exclude property worked on a ReferenceProperty that did not contain a class with another ReferenceProperty attribute. In this case the Article class holds another ReferenceProperty to a another class. Any idea what could be the problem?
Thanks in advance
Your problem seems to be, at least partly, one of syntax -- you want the following:
exclude = ('article',)
Single parentheses without commas in them are just parenthesized expressions; they are evaluated earlier but do not mean "this is a tuple literal" -- that requires a colon.
精彩评论