https://github.com/sourcepirate/tailow
A Asyncio wrapper around motor
https://github.com/sourcepirate/tailow
Last synced: 19 days ago
JSON representation
A Asyncio wrapper around motor
- Host: GitHub
- URL: https://github.com/sourcepirate/tailow
- Owner: sourcepirate
- License: mit
- Created: 2018-06-12T15:54:32.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-08-01T11:10:45.000Z (almost 7 years ago)
- Last Synced: 2024-08-08T21:49:58.370Z (almost 2 years ago)
- Language: Python
- Homepage: https://tailow.readthedocs.io/en/latest/
- Size: 33.2 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Tailow
[](https://travis-ci.org/sourcepirate/tailow)
[](https://tailow.readthedocs.io/en/latest/?badge=latest)
[](https://badge.fury.io/py/tailow)
A ORM wrapper around motor
## Usage
```python
import asyncio
from tailow.fields import *
from pymongo import ASCENDING
from tailow.document import Document
class Address(Document):
address = StringField(required=True)
class Student(Document):
name = StringField(required=True)
age = IntegerField(required=True)
std = IntegerField(required=True)
address = ReferenceField(Address)
class Meta:
name = "students"
indexes = [(age, ASCENDING)]
async def get_all_students():
values = await Student.objects.filter(name="sathya").limit(10).skip(2).find()
print(values)
evloop = asyncio.get_event_loop()
evloop.run_until_complete(get_all_students())
```
## Provides
* Querying via Q objects.
* Special Operators.
* Index Support.
## License
MIT.