Skip to content

Commit

Permalink
#10 Add Even Model and config key
Browse files Browse the repository at this point in the history
  • Loading branch information
pantunes committed Mar 2, 2020
1 parent a61e3a4 commit 98963e7
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xtcryptosignals/config/server.dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ CREATE_MODEL_TICKER=True

VAPID_CLAIMS='[email protected]'
VAPID_PRIVATE_KEY='private_key.pem'

COINMARKETCAL_API_KEY='your_coin_market_cal_api_key'
4 changes: 4 additions & 0 deletions xtcryptosignals/config/server.prod.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ CREATE_MODEL_TICKER=False
# Must change these values
VAPID_CLAIMS='[email protected]'
VAPID_PRIVATE_KEY='path/to/private_key'

# Register and grab your CoinMarketCal API KEY in https://coinmarketcal.com
# and set it here.
COINMARKETCAL_API_KEY='your_coin_market_cal_api_key'
35 changes: 35 additions & 0 deletions xtcryptosignals/tasks/models/event.py
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 mongoengine import (
IntField,
StringField,
DictField,
ListField,
DateField,
BooleanField,
)
from xtcryptosignals.common.models import DocumentValidation


class Event(DocumentValidation):
title = StringField(required=True)
tickers = ListField(StringField(required=True))
categories = ListField(StringField(required=True))
can_occur_before = BooleanField(required=True)
json_id = IntField(required=True)
json = DictField(required=True)
happening_on = DateField(required=True)

meta = {
"collection": "event",
"indexes": [("-happening_on",), ],
"ordering": ["-happening_on"],
}

0 comments on commit 98963e7

Please sign in to comment.