-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Algorand Project * Update CHANGELOG.md
- Loading branch information
Showing
5 changed files
with
43 additions
and
0 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions
35
xtcryptosignals/server/migrations/20211028181600_add_algorand.py
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,35 @@ | ||
__author__ = "Paulo Antunes" | ||
__copyright__ = "Copyright 2018, XTCryptoSignals" | ||
__credits__ = [ | ||
"Paulo Antunes", | ||
] | ||
__license__ = "GPL" | ||
__maintainer__ = "Paulo Antunes" | ||
__email__ = "[email protected]" | ||
|
||
|
||
from mongodb_migrations.base import BaseMigration | ||
from xtcryptosignals.common.utils import use_mongodb | ||
from xtcryptosignals.server.api.projects.models import Project | ||
from xtcryptosignals.tasks import settings as s | ||
|
||
|
||
PROJECTS = dict( | ||
ALGO=dict( | ||
name="Algorand", | ||
website="https://algorand.com", | ||
twitter="https://twitter.com/Algorand", | ||
wikipedia="https://en.wikipedia.org/wiki/Algorand", | ||
), | ||
) | ||
|
||
|
||
class Migration(BaseMigration): | ||
@use_mongodb(db=s.MONGODB_NAME, host=s.MONGODB_HOST, port=s.MONGODB_PORT) | ||
def upgrade(self): | ||
for k, v in PROJECTS.items(): | ||
Project(**{**{"coin_or_token": k}, **v}).save() | ||
print(f"Adding Project: {k}") | ||
|
||
def downgrade(self): | ||
pass |
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