-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- provide/update more docs - add asgi import discovery
- Loading branch information
Showing
16 changed files
with
148 additions
and
171 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
# Edgy People | ||
# Edgy Contributors | ||
|
||
## The Special Ones | ||
|
||
Currently there are no special ones but we are hoping this will change soon. | ||
Edgy wouldn't be possible in this way without this people. | ||
|
||
## The Legends | ||
- @kokoserver | ||
|
||
Currently there are no legends but we are hoping this will change soon. | ||
He provided a lot of valuable bug reports and PRs. Especially related to migrations. |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Extensions | ||
|
||
Edgy has extension support build on the Monkay extensions system. Adding extensions | ||
is possible in settings via the attribute/parameter `extensions`. | ||
|
||
They must implement the monkay extension protocol or return as a callable a class implementing the extension protocol. | ||
This sounds hard but it isn't: | ||
|
||
``` python | ||
{!> ../docs_src/extensions/settings !} | ||
``` | ||
|
||
You can also lazily provide them via add_extension (should happen before the instance is set) | ||
|
||
|
||
``` python | ||
{!> ../docs_src/extensions/add_extension !} | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from dataclasses import dataclass | ||
|
||
import edgy | ||
|
||
|
||
@dataclass | ||
class Extension(ExtensionProtocol[edgy.Instance, edgy.Registry]): | ||
name: str = "hello" | ||
|
||
def apply(self, monkay_instance: Monkay[edgy.Instance, edgy.Registry]) -> None: | ||
"""Do something here""" | ||
|
||
|
||
@dataclass | ||
class ExtensionLessTyped(ExtensionProtocol): | ||
name: str = "hello" | ||
|
||
def apply(self, monkay_instance: Monkay) -> None: | ||
"""Do something here""" | ||
|
||
|
||
edgy.monkay.add_extension(Extension()) | ||
|
||
edgy.monkay.add_extension(ExtensionLessTyped()) |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from typing import Any | ||
from edgy import EdgySettings | ||
|
||
|
||
@dataclass | ||
class Extension(ExtensionProtocol[edgy.Instance, edgy.Registry]): | ||
name: str = "hello" | ||
|
||
def apply(self, monkay_instance: Monkay[edgy.Instance, edgy.Registry]) -> None: | ||
"""Do something here""" | ||
|
||
|
||
@dataclass | ||
class ExtensionLessTyped(ExtensionProtocol): | ||
name: str = "hello" | ||
|
||
def apply(self, monkay_instance: Monkay) -> None: | ||
"""Do something here""" | ||
|
||
|
||
class ExtensionSettings(EdgySettings): | ||
extensions: list[Any] = [Extension(), ExtensionLessTyped()] |
Oops, something went wrong.