crate-peewee-0.1.0
توضیحات
Crate driver for peewee
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | crate-peewee-0.1.0 |
| نام | crate-peewee |
| نسخه کتابخانه | 0.1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Mathias Fußenegger |
| ایمیل نویسنده | pip@zignar.net |
| آدرس صفحه اصلی | https://github.com/mfussenegger/crate-peewee |
| آدرس اینترنتی | https://pypi.org/project/crate-peewee/ |
| مجوز | - |
============
crate-peewee
============
Crate driver for `peewee <https://github.com/coleifer/peewee>`_, a small, expressive ORM.
Most basic operations work. Support for special Crate features like fulltext
search or object and array fields is still a work in progress.
For a full documentation take a look at the `peewee documentation
<http://docs.peewee-orm.com/en/latest/>`_.
Usage
=====
Use peewee with Crate::
from peewee import Model, CharField
from crate.peewee import CrateDatabase
from uuid import uuid4
db = CrateDatabase()
db.connect()
def gen_key():
return str(uuid4())
class User(Model):
id = CharField(null=True, default=gen_key, primary_key=True)
name = CharField(null=True)
class Meta:
database = db
db.create_tables([User], safe=True)
arthur = User.create(name='Arthur')
db.execute_sql('refresh table user')
print([u for u in User.select(User.name).tuples()])
نحوه نصب
نصب پکیج whl crate-peewee-0.1.0:
pip install crate-peewee-0.1.0.whl
نصب پکیج tar.gz crate-peewee-0.1.0:
pip install crate-peewee-0.1.0.tar.gz