基于pymongo的activerecord模式o/r映射器
SixIsles的Python项目详细描述
基于pymongo的activerecord模式o/r映射器
依赖关系
- python2.6或更高版本
- Pymongo=3.1.1
安装
$ pip install SixIsles
示例
添加GitHub存储库文档
fromsixIslesimportStructure,Document,get_clientfromsixIsles.typesimportObjectId,StringclassRepository(Document):struct=Structure(_id=ObjectId(),name=String(),author=String(),url=String())classMeta:database=get_client("test_db_name","localhost")document=Repository()document.name="SixIsles"document.author="teitei-tk"document.url="https://github.com/teitei-tk/SixIsles"document.insert()ordocument=Repository({"name":"SixIsles","author":"teitei-tk","url":"https://github.com/teitei-tk/SixIsles"})document.insert()
$ mongo ..... ..... > use test_db_name switched to db test_db_name > show collections; repository system.indexes > db.repository.find(){"_id" : ObjectId("565895aacc7474890284fc8d"), "url" : "https://github.com/teitei-tk/SixIsles", "name" : "SixIsles", "author" : "teitei-tk"} >
待办事项
- []添加测试代码
- []更新自述文件
- []注册CI工具
许可证
- 麻省理工学院