-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmodels.py
55 lines (33 loc) · 1.11 KB
/
models.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
55
from typing import Optional
from app import memgraph
from gqlalchemy import Node, Field, Relationship
class User(Node):
name: str = Field(index=True, exists=True, unique=True, db=memgraph)
class Stream(User):
name: Optional[str] = Field(
index=True, exists=True, unique=True, db=memgraph, label="User"
)
id: str = Field(index=True, exists=True, unique=True, db=memgraph)
url: Optional[str] = Field()
followers: Optional[int] = Field()
createdAt: Optional[str] = Field()
totalViewCount: Optional[int] = Field()
description: Optional[str] = Field()
class Language(Node):
name: str = Field(unique=True, db=memgraph)
class Game(Node):
name: str = Field(unique=True, db=memgraph)
class Team(Node):
name: str = Field(unique=True, db=memgraph)
class Speaks(Relationship, type="SPEAKS"):
pass
class Plays(Relationship, type="PLAYS"):
pass
class IsPartOf(Relationship, type="IS_PART_OF"):
pass
class Vip(Relationship, type="VIP"):
pass
class Moderator(Relationship, type="MODERATOR"):
pass
class Chatter(Relationship, type="CHATTER"):
pass