Skip to main content

a package use orm to operate mongo

Project description

### mongorm
一个简单的基于pymongo的orm

### 使用示例


```python
from mongorm import MongoModel
from field import CharField, IntField
class User(MongoModel):

class Meta:
# 设置mongo的数据库名称
dbname = "mongoorm"
# 设置集合名词
collection = "test"
user = CharField(is_must=True, default="xxx")
age = IntField(is_must=True)

if __name__ == "__main__":
# 下面两种方法均可以插入一条记录
User.objects.create(user="wupengxin", age=10)
print User(user="usertest", age=12).create()
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymongorm-0.0.3.tar.gz (6.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page