Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python35
/
lib64
/
python3.5
/
site-packages
/
playhouse
/
__pycache__
/
File Content:
read_slave.cpython-35.pyc
R6�W� � @ s* d Z d d l TGd d � d e � Z d S)ag Support for using a dedicated read-slave. The read database is specified as a Model.Meta option, and will be used for SELECT statements: master = PostgresqlDatabase('master') read_slave = PostgresqlDatabase('read_slave') class BaseModel(ReadSlaveModel): class Meta: database = master read_slaves = [read_slave] # This database will be used for SELECTs. # Now define your models as you would normally. class User(BaseModel): username = CharField() # To force a SELECT on the master database, you can instantiate the SelectQuery # by hand: master_select = SelectQuery(User).where(...) � )�*c sR e Z d Z e d d � � Z e � f d d � � Z e � f d d � � Z � S)�ReadSlaveModelc C s_ t | j d d � s | j j St | d d � } | d t | j j � | _ | j j | j S)N�read_slaves�_read_slave_idx� ���)�getattrZ_meta�database�lenr r )�clsZcurrent_idx� r �/read_slave.py�_get_read_database s z!ReadSlaveModel._get_read_databasec s. t t | � j | | � } | j � | _ | S)N)�superr �selectr r )r �args�kwargs�query)� __class__r r r # s zReadSlaveModel.selectc sF t t | � j | | � } | j j � j d � rB | j � | _ | S)Nr )r r �rawZ_sql�lower� startswithr r )r r r r )r r r r ) s zReadSlaveModel.raw)�__name__� __module__�__qualname__�classmethodr r r r r )r r r s r N)�__doc__ZpeeweeZModelr r r r r �<module> s
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
__init__.cpython-35.opt-1.pyc
95 bytes
0644
__init__.cpython-35.pyc
95 bytes
0644
apsw_ext.cpython-35.opt-1.pyc
7645 bytes
0644
apsw_ext.cpython-35.pyc
7645 bytes
0644
berkeleydb.cpython-35.opt-1.pyc
3273 bytes
0644
berkeleydb.cpython-35.pyc
3273 bytes
0644
csv_loader.cpython-35.opt-1.pyc
135 bytes
0644
csv_loader.cpython-35.pyc
135 bytes
0644
csv_utils.cpython-35.opt-1.pyc
11700 bytes
0644
csv_utils.cpython-35.pyc
11700 bytes
0644
dataset.cpython-35.opt-1.pyc
13706 bytes
0644
dataset.cpython-35.pyc
13706 bytes
0644
db_url.cpython-35.opt-1.pyc
3231 bytes
0644
db_url.cpython-35.pyc
3231 bytes
0644
djpeewee.cpython-35.opt-1.pyc
5898 bytes
0644
djpeewee.cpython-35.pyc
5898 bytes
0644
fields.cpython-35.opt-1.pyc
13006 bytes
0644
fields.cpython-35.pyc
13006 bytes
0644
flask_utils.cpython-35.opt-1.pyc
6072 bytes
0644
flask_utils.cpython-35.pyc
6110 bytes
0644
gfk.cpython-35.opt-1.pyc
6168 bytes
0644
gfk.cpython-35.pyc
6168 bytes
0644
hybrid.cpython-35.opt-1.pyc
2203 bytes
0644
hybrid.cpython-35.pyc
2203 bytes
0644
kv.cpython-35.opt-1.pyc
6929 bytes
0644
kv.cpython-35.pyc
6929 bytes
0644
migrate.cpython-35.opt-1.pyc
23225 bytes
0644
migrate.cpython-35.pyc
23225 bytes
0644
pool.cpython-35.opt-1.pyc
8149 bytes
0644
pool.cpython-35.pyc
8149 bytes
0644
postgres_ext.cpython-35.opt-1.pyc
17267 bytes
0644
postgres_ext.cpython-35.pyc
17267 bytes
0644
read_slave.cpython-35.opt-1.pyc
1788 bytes
0644
read_slave.cpython-35.pyc
1788 bytes
0644
reflection.cpython-35.opt-1.pyc
19024 bytes
0644
reflection.cpython-35.pyc
19024 bytes
0644
shortcuts.cpython-35.opt-1.pyc
5786 bytes
0644
shortcuts.cpython-35.pyc
5786 bytes
0644
signals.cpython-35.opt-1.pyc
3112 bytes
0644
signals.cpython-35.pyc
3112 bytes
0644
sqlcipher_ext.cpython-35.opt-1.pyc
4624 bytes
0644
sqlcipher_ext.cpython-35.pyc
4624 bytes
0644
sqlite_ext.cpython-35.opt-1.pyc
37434 bytes
0644
sqlite_ext.cpython-35.pyc
37525 bytes
0644
sqlite_udf.cpython-35.opt-1.pyc
17159 bytes
0644
sqlite_udf.cpython-35.pyc
17159 bytes
0644
test_utils.cpython-35.opt-1.pyc
4128 bytes
0644
test_utils.cpython-35.pyc
4174 bytes
0644
N4ST4R_ID | Naxtarrr