-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed README.md. Updated package to use eventsourcing 9.3.5, which do…
…esn't depend on database tables having been created when application is constructed. Also reworked discussion in README.md to improve explanation, and include suggestion about putting application environment variables in Django settings file.
- Loading branch information
1 parent
780b666
commit 70648cd
Showing
13 changed files
with
326 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# -*- coding: utf-8 -*- | ||
from typing import Any | ||
|
||
from eventsourcing.persistence import ( | ||
AggregateRecorder, | ||
ApplicationRecorder, | ||
InfrastructureFactory, | ||
OperationalError, | ||
ProcessRecorder, | ||
) | ||
|
||
|
||
class Factory(InfrastructureFactory): | ||
def __init__(self, **kwargs: Any) -> None: | ||
msg = ( | ||
"Django app not ready. Please call django.setup() after setting " | ||
"environment variable DJANGO_SETTINGS_MODULE to the settings module of a " | ||
"Django project that has 'eventsourcing_django' included in its " | ||
"INSTALLED_APPS setting, and ensure the Django project's database has been " | ||
"migrated before calling the methods of your event sourcing application." | ||
) | ||
raise OperationalError(msg) | ||
|
||
def aggregate_recorder(self, purpose: str = "events") -> AggregateRecorder: | ||
raise NotImplementedError() | ||
|
||
def application_recorder(self) -> ApplicationRecorder: | ||
raise NotImplementedError() | ||
|
||
def process_recorder(self) -> ProcessRecorder: | ||
raise NotImplementedError() |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,15 @@ | ||
# -*- coding: utf-8 -*- | ||
from eventsourcing.cipher import AESCipher | ||
|
||
from tests.djangoproject.settings import * # noqa: F403 | ||
|
||
INSTALLED_APPS = INSTALLED_APPS + ["tests.training_school"] # noqa: F405 | ||
|
||
EVENT_SOURCING_SETTINGS = EVENT_SOURCING_APPLICATION = { | ||
"PERSISTENCE_MODULE": "eventsourcing_django", | ||
"DJANGO_DB_ALIAS": "postgres", | ||
"IS_SNAPSHOTTING_ENABLED": "y", | ||
"COMPRESSOR_TOPIC": "eventsourcing.compressor:ZlibCompressor", | ||
"CIPHER_TOPIC": "eventsourcing.cipher:AESCipher", | ||
"CIPHER_KEY": AESCipher.create_key(num_bytes=32), | ||
} |
Oops, something went wrong.