我希望能夠獲得我創建的文檔所需的列表或某種字段集合。舉例來說,這裏是我的文檔:從mongoengine的Document中獲取必填字段?
nickName = StringField(required=True)
password = StringField(required=True)
firstName = StringField()
lastName = StringField()
joinDate = DateTimeField(required=True)
lastVisited = DateTimeField(required=True)
subscriptions = DictField(field=ObjectIdField())
isActivated = BooleanField(default=True)
profileImage = FileField()
isModerator = BooleanField(default=False)
description = StringField()
location = GeoPointField()
email = EmailField()
settings = DictField()
^從這個文件,我應該得到:
["nickName","password","joinDate","lastVisited"]
的結果是必填項。這可能嗎?如果是這樣,我怎麼能達到預期的結果。
在此先感謝!
關於錢,謝謝一堆! – AlfredN 2011-12-21 09:11:08