Master Slave Support For PeeWee
Python Shell
Pull request Compare This branch is 2 commits behind wayhome:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
pwmd
tests
.gitignore
.travis.yml
README.rst
setup.cfg
setup.py

README.rst

pwmd

Master/Slave Support For PeeWee. Now only support mysql.

The source code is locate at github .

Build Status

Usage

from peewee import Model, CharField, DateField, BooleanField
from pwmd import MultiMySQLDatabase

DATABASE = {'master': 'mysql://root@localhost/test_app',
            'slaves': ['mysql://root@localhost/test_app']}
db = MultiMySQLDatabase(DATABASE)
db.connect()


class BaseModel(Model):
    class Meta:
        database = db


class Person(BaseModel):
    name = CharField()
    birthday = DateField()
    is_relative = BooleanField()