Created
November 16, 2017 17:24
-
-
Save kishorenc/f18dbe66c3adb86d7a2d8546df5fba20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Student: | |
def __init__(self, id, first_name, last_name): | |
self.id = id | |
self.first_name = first_name | |
self.last_name = last_name | |
class Students: | |
def get_all(self): | |
r = request.get('/students') | |
students_json = r.loads(r.text) | |
students = [] | |
for student_obj in students_json: | |
students.append(Student(student_obj['id'], student_obj['first_name'], student_obj['last_name'])) | |
return student |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment