2
저는 CMIS 호환 스토리지를 백엔드 (내 경우 Alfresco)로 사용하는 라이브러리를 개발 중입니다. Flask-SQLAlchemy 및 Django와 비슷한 "섹시한"API를 작성하고 싶습니다. 문제는 필자가 파이썬에서 이러한 고급 프로그래밍에 익숙하지 않다는 것입니다. 고급 라이브러리 및 API 디자인
# 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()
나도 같은 연결을 사용하는 모델에서 상속의 모든 클래스를 원하는 전체 개체 모델에 대한 하나의 백엔드가있을 것입니다 때문에
명시 적으로 등록하지 않고 : 다음은이 라이브러리를 사용하는 상상 방법입니다.어떤 도움이 많이 주시면 감사하겠습니다 :)
내 라이브러리는 cmislib의 캡슐화는 데이터베이스 개체를 장고와 유사한 모델을 허용하는 것입니다. 나는 모든 "뒤에"물건에 대해 cmislib를 사용합니다 :) – codehugger