-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c18b955
commit 7619a1a
Showing
12 changed files
with
53 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .TenantContext import TenantContext | ||
# flake8: noqa F401 | ||
from .TenantContext import TenantContext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from masonite.facades import Facade | ||
|
||
|
||
class Tenancy(metaclass=Facade): | ||
key = "multitenancy" | ||
key = "multitenancy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,31 @@ | ||
from masonite.request.request import Request | ||
from ..models.Tenant import Tenant | ||
|
||
|
||
class Tenancy: | ||
|
||
def reset_connection() -> None: | ||
"""Resets the connection to the default connection.""" | ||
... | ||
|
||
def set_connection(tenant: Tenant) -> None: | ||
"""Sets the connection for the tenant.""" | ||
... | ||
|
||
def get_tenants() -> list[Tenant]: | ||
"""Returns a list of all tenants.""" | ||
... | ||
|
||
def find_tenant(request: Request) -> Tenant | None: | ||
"""Returns the tenant for the current request.""" | ||
... | ||
|
||
def delete(tenant: Tenant) -> None: | ||
"""Deletes a tenant.""" | ||
... | ||
|
||
def create(name: str, domain: str, database: str) -> Tenant: | ||
"""Creates a new tenant.""" | ||
... | ||
|
||
def get_tenant_by_domain(domain: str) -> Tenant | None: | ||
"""Returns a tenant by domain.""" | ||
... | ||
|
||
def get_tenant_by_database(database: str) -> Tenant | None: | ||
"""Returns a tenant by database.""" | ||
... | ||
|
||
def get_tenant_by_id(id: int) -> Tenant | None: | ||
"""Returns a tenant by id.""" | ||
... | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .Tenancy import Tenancy | ||
# flake8: noqa F401 | ||
from .Tenancy import Tenancy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters