CMIS 互換ストレージをバックエンドとして使用するライブラリを開発しています (私の場合は Alfresco)。Flask-SQLAlchemy や Django に似た「セクシーな」API を作成したいと考えています。問題は、私が Python での高度なプログラミングに慣れていないことです。このライブラリを使用する想像上の方法は次のとおりです。
# Here is the connector that does the actual request to the CMIS server
c = CMISConnector('url', 'username', 'password')
# Here I declare the model with the desired property fields. A model
# can be either a folder or a document in Alfresco
class SomeModel(c.Model):
name = c.Property('cmis:name')
# Some query and create examples...
foo = SomeModel.query.first(name='John Doe')
print foo.name
bar = SomeModel(name='Jane Doe')
bar.save()
オブジェクト モデル全体に対して 1 つのバックエンドがあるため、Model から継承するすべてのクラスで、明示的に登録しなくても同じ接続を使用する必要があります。
どんな助けでも大歓迎です:)