Revision: 10173
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at December 11, 2008 03:22 by tamuratetsuya
Initial Code
1. è¨å®šæ–¹æ³• class MyModelRoot(db.Model): text = db.StringProperty() date = db.DateTimeProperty(auto_now_add=True) class MyModel(db.Model): text = db.StringProperty() date = db.DateTimeProperty(auto_now_add=True) # 親å関係を作らãªã„。 model = MyModel(text="hoge") # 親å関係を作る。 root = MyModelRoot(text="fuga") model = MyModel(parent=root, text="hoge") # parent=root, 1. parentを指定ã—ãŸå–得方法 "ANCESTOR IS"を使用ã™ã‚‹ã€‚ parentKey = 1 root = MyModelRoot.get_by_id(key) models = MyModel.gql("WHERE ANCESTOR IS :parent", parent=root)
Initial URL
Initial Description
Initial Title
Googleã®ãƒ‡ãƒ¼ã‚¿ã¯è¦ªå関係を指定ã§ãã‚‹ Modelã®parent属性ã§è¨å®šã§ãã‚‹
Initial Tags
google, python, django
Initial Language
Python