-
Notifications
You must be signed in to change notification settings - Fork 1
/
init_db_script.py
54 lines (41 loc) · 1.43 KB
/
init_db_script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from mongoengine.errors import NotUniqueError
from db.subject import Subject
from db.observer import Observer
from db.ticket import Status
try:
brasil = Subject("🇧🇷", "Decred Brasil",
"wss://split-ticket-svc.stake.decredbrasil"
".com:8477/watchWaitingList",
"dcrbr1").save()
except NotUniqueError:
brasil = Subject.objects.get(name="Decred Brasil")
try:
voting = Subject("🇺🇸", "Decred Voting",
"wss://matcher.decredvoting.com:8477/"
"watchWaitingList",
"decredvoting1").save()
except NotUniqueError:
voting = Subject.objects.get(name="Decred Voting")
try:
split = Subject("🏴☠️", "99split",
"wss://split.99split.com:8477/"
"watchWaitingList",
"99split").save()
except NotUniqueError:
split = Subject.objects.get(name="99split")
try:
channel = Observer("@ticketsplitting", "@ticketsplitting").save()
except NotUniqueError:
channel = Observer.objects.get(chat_id="@ticketsplitting")
try:
immature = Status('immature').save()
except NotUniqueError:
immature = Status.objects.get(name='immature')
try:
live = Status('live').save()
except NotUniqueError:
live = Status.objects.get(name='live')
try:
voted = Status('voted').save()
except NotUniqueError:
voted = Status.objects.get(name='voted')