+
Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Using methods of wrong routers #68

@hariton27sy

Description

@hariton27sy

There are cases when several routers in use. It may be used when the most of data is written to the cluster with master and slaves but some of apps should use another db.

In these cases RouterMiddleware is able to use methods from wrong router.

class Routers(object):
def __getattr__(self, name):
for r in db.router.routers:
if hasattr(r, name):
return getattr(r, name)
msg = 'Not found the router with the method "%s".' % name
raise AttributeError(msg)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载