-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.py
28 lines (25 loc) · 979 Bytes
/
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
from mongoengine import Document, IntField, StringField, DictField
class HighSchool(Document):
id = IntField(required=True, primary_key=True)
name = StringField(required=True)
street = StringField(required=True)
suburb = StringField(required=True)
postcode = IntField(required=True)
students = IntField(required=True)
selective = StringField(required=True)
gender = StringField(required=True)
loc = DictField(required=True)
attendance_rates = DictField()
selective_entry_scores = DictField()
enrollments = DictField()
def __init__(self, id, name, street, suburb, postcode, students, selective, gender, loc, *args, **kwargs):
super().__init__(*args, **kwargs)
self.id = id
self.name = name
self.street = street
self.suburb = suburb
self.postcode = postcode
self.students = students
self.selective = selective
self.gender = gender
self.loc = loc