は、彼らがこのコレクションオブジェクトが属するデータベースオブジェクトを表すためにself._Collection__database
を使用します。フラスコ - PyMongo:どうして "self._Collection__database"?フラスコ-PyMongoで
class Collection(collection.Collection):
"""Custom sub-class of :class:`pymongo.collection.Collection` which
adds Flask-specific helper methods.
"""
def __getattr__(self, name):
attr = super(Collection, self).__getattr__(name)
if isinstance(attr, collection.Collection):
db = self._Collection__database
return Collection(db, attr.name)
return attr
なぜself._Collection__database
ないself.__database
のですか?
test <a>and <i>