-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathapi_types.py
78 lines (56 loc) · 1.56 KB
/
api_types.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
"""
Classes that bind the MongoEngine models with the Graphene GraphQL API
"""
import models
from graphene.relay import Node
from graphene_mongo import MongoengineObjectType, converter
import graphene
class College(MongoengineObjectType):
"""
A sub-college of Cal Poly. E.g. College of Engineering
"""
class Meta:
model = models.College
interfaces = (Node,)
class Department(MongoengineObjectType):
"""
An area of study within a college. E.g. Computer Science Department
"""
class Meta:
model = models.Department
interfaces = (Node,)
class Program(MongoengineObjectType):
"""
A field of study taken up by a student. E.g. majoring in Computer Science
"""
class Meta:
model = models.Program
interfaces = (Node,)
class Room(MongoengineObjectType):
"""
A publically accessible room inside a campus building.
"""
class Meta:
model = models.Room
interfaces = (Node,)
class Club(MongoengineObjectType):
"""
A Cal Poly student organization
"""
class Meta:
model = models.Club
interfaces = (Node,)
class Professor(MongoengineObjectType):
"""
A person who teaches a class at Cal Poly
"""
class Meta:
model = models.Professor
interfaces = (Node,)
class Course(MongoengineObjectType):
"""
An abstract course that is taught at Cal Poly. For specific sections/classes taught in a specific quarter, see Section
"""
class Meta:
model = models.Course
interfaces = (Node,)