[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.141.25.125: ~ $
U

S��W��@s dZddlTGdd�de�ZdS)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(...)
�)�*cs<eZdZedd��Ze�fdd��Ze�fdd��Z�ZS)�ReadSlaveModelcCsFt|jdd�s|jjSt|dd�}|dt|jj�|_|jj|jS)N�read_slaves�_read_slave_idx����)�getattrZ_meta�database�lenrr)�clsZcurrent_idx�r�/read_slave.py�_get_read_databases
z!ReadSlaveModel._get_read_databasecs tt|�j||�}|��|_|S)N)�superr�selectrr	�r�args�kwargsZquery��	__class__rr
r#s
zReadSlaveModel.selectcs0tt|�j||�}|j���d�r,|��|_|S)Nr)rr�rawZ_sql�lower�
startswithrr	rrrr
r)s
zReadSlaveModel.raw)�__name__�
__module__�__qualname__�classmethodrrr�
__classcell__rrrr
rs
rN)�__doc__ZpeeweeZModelrrrrr
�<module>s

Filemanager

Name Type Size Permission Actions
__init__.cpython-38.opt-1.pyc File 103 B 0644
__init__.cpython-38.pyc File 103 B 0644
apsw_ext.cpython-38.opt-1.pyc File 7.09 KB 0644
apsw_ext.cpython-38.pyc File 7.09 KB 0644
berkeleydb.cpython-38.opt-1.pyc File 2.99 KB 0644
berkeleydb.cpython-38.pyc File 2.99 KB 0644
csv_loader.cpython-38.opt-1.pyc File 141 B 0644
csv_loader.cpython-38.pyc File 141 B 0644
csv_utils.cpython-38.opt-1.pyc File 10.67 KB 0644
csv_utils.cpython-38.pyc File 10.67 KB 0644
dataset.cpython-38.opt-1.pyc File 12.52 KB 0644
dataset.cpython-38.pyc File 12.52 KB 0644
db_url.cpython-38.opt-1.pyc File 2.91 KB 0644
db_url.cpython-38.pyc File 2.91 KB 0644
djpeewee.cpython-38.opt-1.pyc File 5.37 KB 0644
djpeewee.cpython-38.pyc File 5.37 KB 0644
fields.cpython-38.opt-1.pyc File 11.8 KB 0644
fields.cpython-38.pyc File 11.8 KB 0644
flask_utils.cpython-38.opt-1.pyc File 5.57 KB 0644
flask_utils.cpython-38.pyc File 5.6 KB 0644
gfk.cpython-38.opt-1.pyc File 5.68 KB 0644
gfk.cpython-38.pyc File 5.68 KB 0644
hybrid.cpython-38.opt-1.pyc File 2.06 KB 0644
hybrid.cpython-38.pyc File 2.06 KB 0644
kv.cpython-38.opt-1.pyc File 6.41 KB 0644
kv.cpython-38.pyc File 6.41 KB 0644
migrate.cpython-38.opt-1.pyc File 21.11 KB 0644
migrate.cpython-38.pyc File 21.11 KB 0644
pool.cpython-38.opt-1.pyc File 7.52 KB 0644
pool.cpython-38.pyc File 7.52 KB 0644
postgres_ext.cpython-38.opt-1.pyc File 15.81 KB 0644
postgres_ext.cpython-38.pyc File 15.81 KB 0644
read_slave.cpython-38.opt-1.pyc File 1.68 KB 0644
read_slave.cpython-38.pyc File 1.68 KB 0644
reflection.cpython-38.opt-1.pyc File 17.11 KB 0644
reflection.cpython-38.pyc File 17.11 KB 0644
shortcuts.cpython-38.opt-1.pyc File 5.26 KB 0644
shortcuts.cpython-38.pyc File 5.26 KB 0644
signals.cpython-38.opt-1.pyc File 2.86 KB 0644
signals.cpython-38.pyc File 2.86 KB 0644
sqlcipher_ext.cpython-38.opt-1.pyc File 4.38 KB 0644
sqlcipher_ext.cpython-38.pyc File 4.38 KB 0644
sqlite_ext.cpython-38.opt-1.pyc File 34.02 KB 0644
sqlite_ext.cpython-38.pyc File 34.09 KB 0644
sqlite_udf.cpython-38.opt-1.pyc File 15.36 KB 0644
sqlite_udf.cpython-38.pyc File 15.36 KB 0644
sqliteq.cpython-38.opt-1.pyc File 9.03 KB 0644
sqliteq.cpython-38.pyc File 9.03 KB 0644
test_utils.cpython-38.opt-1.pyc File 3.93 KB 0644
test_utils.cpython-38.pyc File 3.96 KB 0644